Commits

nilo  committed 490ef84

Use data-special-attr="true" in favour of setting a class for marking elements having special attributes, because this also works when there is a dynamic class attribute on the element.

  • Participants
  • Parent commits 74a79b3

Comments (0)

Files changed (1)

File src/obviel/obviel-template.js

 
         // setting attributes with data (data-id, data-src) become
         // that attribute (id, src)
-        $('.obviel-template-special-attr', el).each(function() {
+        $('*[data-special-attr=true]', el).each(function() {
             var name, value;
 
             for (name in SPECIAL_ATTR) {
             }
             
             var el = $(this);
-            el.removeClass('obviel-template-special-attr');
+            el.attr('data-special-attr', null);
             if (el.attr('class') === '') {
                 el.removeAttr('class');
             }
                 throw new module.CompilationError(
                     el, "data-" + name + " cannot be empty");
             }
-            $(el).addClass('obviel-template-special-attr');
+            $(el).attr('data-special-attr', 'true');
         }
     };