Ticket #2529108 (accepted enhancement)
Reporter Matt Parker |
Opened: 07/26/10 Last modified: 03/11/12 Status: accepted Type: enhancement |
Owner Luke Smith |
Target Release: Priority: P4 (low) |
|---|---|---|---|
| Summary: | Stylesheet enableRule and disableRule - new methods | ||
| Description: | Duplicate of http://yuilibrary.com/projects/yui2/ticket/2529061 (but that's for YUI2). The following snippet are additional public methods for Stylesheet. disableRule(match) allows you to temporarily turn off some of the rules in the Stylesheet; match is a string or RegExp to compare to Although this is in YUI2.8, it might be good to have in 3 too - I'll file a separate ticket. This doesn't fix the !important bug issues with Opera (http://yuilibrary.com/forum/viewtopic.php?f=89&t=4304&start=0&hilit=stylesheet) There's also an extra var _disabledRules in the constructor. [code]
enableRule : function (sel) { var i, for (i in disabled) { if (YAHOO.util.Lang.isString(i) && i.match(sel) !== null) { toEnable.push(i); } for (i=0; i<toEnable.length; i++) { idx = sheet[_rules].length; this.set(thisToEnable.selectorText,thisToEnable.css); } return this; }, /**
disableRule : function (sel) { var i, j = 0, for (i in enabled) { if (YAHOO.util.Lang.isString(i) && i.match(sel) !== null && enabled[i].style.cssText) { toDisable.push(i);_disabledRules[i] = { css: enabled[i].style.cssText, selectorText: enabled[i].selectorText}; } j++; for (i=0; i<toDisable.length; i++) { this.unset(toDisable[i]); } return this; } |
||
| Type: | enhancement | Observed in Version: | 3.1.1 |
| Component: | StyleSheet | Severity: | S4 (low) |
| Assigned To: | Luke Smith | Target Release: | |
| Location: | Library Code | Priority: | P4 (low) |
| Tags: | Relates To: | #2529061 | |
| Browsers: | Firefox 3.x - PC,IE - All | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 08/9/10
|
|
Posted: 11/30/11
Resolving as "expired" due to lack of activity. Please feel free to reopen if this issue is still important to you. |
|
Posted: 12/5/11
|
|
Posted: 03/11/12
This is still a valid enhancement. Though there are limited resources to do this, there's no need for it to be closed. The !important issue is being tracked in ticket #2528707 |
|
Posted: 03/11/12
|
StyleSheet is due for an architectural overhaul, so I'll put this in there when I do that refactoring.