From: Eric S. <svn...@pl...> - 2009-05-31 19:50:43
|
Author: esteele Date: Sun May 31 19:50:36 2009 New Revision: 87213 Modified: banjo/trunk/banjo.js Log: Properly write class/tag order. Modified: banjo/trunk/banjo.js ============================================================================== --- banjo/trunk/banjo.js (original) +++ banjo/trunk/banjo.js Sun May 31 19:50:36 2009 @@ -30,10 +30,12 @@ selector = obj.attr('tagName').toLowerCase() + "#" + id + " " + selector; } else{ - selector = selector + " " + obj.attr('tagName').toLowerCase(); + tag = obj.attr('tagName').toLowerCase(); if (obj.attr('class')) - selector = selector + "." + obj.attr('class'); + tag = tag + "." + obj.attr('class').replace(' ', '.'); + selector = tag + " " + selector; } + obj = obj.parent(); } // selector = selector + ":nth-child(2)" @@ -65,9 +67,10 @@ selector = obj.attr('tagName').toLowerCase() + "#" + id + " " + selector; } else{ - selector = selector + " " + obj.attr('tagName').toLowerCase(); + tag = obj.attr('tagName').toLowerCase(); if (obj.attr('class')) - selector = selector + "." + obj.attr('class'); + tag = tag + "." + obj.attr('class').replace(' ', '.'); + selector = tag + " " + selector; } obj = obj.parent(); } |