Changeset 667


Ignore:
Timestamp:
06/11/10 15:56:52 (2 years ago)
Author:
mr_lundis
Message:

Workaround to support combined css selectors in IE + unit test. Fixes #196.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/test/unit/index.html

    r632 r667  
    114114 
    115115    }); 
     116 
     117    test("Adding combined CSS selectors", function () { 
     118        expect(1); 
     119         
     120        var doc = jQuery.wymeditors(0)._doc, 
     121            styles = doc.styleSheets[0]; 
     122 
     123        jQuery.wymeditors(0).addCssRule(styles, {name:'p,h1,h2', css:'font-style:italic'}); 
     124        equals(jQuery('p', doc).css('fontStyle'), 'italic', 'Font-style'); 
     125 
     126    }); 
    116127}; 
    117128 
  • trunk/src/wymeditor/jquery.wymeditor.explorer.js

    r655 r667  
    137137 
    138138WYMeditor.WymClassExplorer.prototype.addCssRule = function(styles, oCss) { 
    139  
    140     styles.addRule(oCss.name, oCss.css); 
     139    // IE doesn't handle combined selectors (#196) 
     140    var selectors = oCss.name.split(','); 
     141    for (var i in selectors) { 
     142        styles.addRule(selectors[i], oCss.css); 
     143    } 
    141144}; 
    142145 
Note: See TracChangeset for help on using the changeset viewer.