home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / AIMP2 / aimp_2.61.583.exe / $TEMP / YandexPackSetup.msi / filD64B4FF876FBE1C1DC8D6CEE733B6F4D < prev    next >
Text File  |  2010-07-12  |  1KB  |  41 lines

  1. XB.UI.Behaviour.Style = XB.UI.Behaviour.extend({
  2.     name: "style",
  3.     nodeName: "html:span",
  4.     
  5.     create: function() {
  6.         this.namespaceURI = XB.UI.consts.STR_HTML_NS;
  7.         
  8.         var parentNode = this.comment.parentNode;
  9.         if (parentNode.localName == "menuitem")
  10.             this.mode = "menuitem";
  11.         
  12.         this.base();
  13.         
  14.         this.on(this.node, "DOMSubtreeModified", this.onModified, false, this);
  15.     },
  16.     
  17.     append: function() {
  18.         if (this.mode == "menuitem") {
  19.         } else
  20.             this.base();
  21.     },
  22.     
  23.     onAttribute: function(attrChangeEvent) {
  24.         var cssProperty = this._attrMap[attrChangeEvent.name];
  25.         if (cssProperty)
  26.             this.node.style[cssProperty] = attrChangeEvent.value;
  27.     },
  28.     
  29.     _attrMap: {
  30.         __proto__: null,
  31.         "color": "color",
  32.         "font-weight": "fontWeight"
  33.     },
  34.     
  35.     onModified: function() {
  36.         if (this.mode == "menuitem") {
  37.             var parentNode = this.comment.parentNode;
  38.             parentNode.setAttribute("label", this.node.textContent);
  39.         }
  40.     }
  41. });