X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/628970a411a24c0e46ce892094a523e0e0f23698..c15d698f84d77c34393d33dbe492d44694619010:/skins/ajax_scripts/javascript_events_api.js?ds=sidebyside diff --git a/skins/ajax_scripts/javascript_events_api.js b/skins/ajax_scripts/javascript_events_api.js index 2539fd9..2083018 100644 --- a/skins/ajax_scripts/javascript_events_api.js +++ b/skins/ajax_scripts/javascript_events_api.js @@ -255,11 +255,14 @@ buildMetaFunctions(); addListener(window, 'load', function(evt) { // html5 facade - if (!document.body.classList) { - var nop = function(){}; - var fakeDOMTokenList = {'length':0, 'item':nop, 'contains':nop, 'add':nop, 'remove':nop, 'toggle':nop}; - Element.prototype.classList = fakeDOMTokenList; + try { + if (!document.body.classList) { + var nop = function(){}; + var fakeDOMTokenList = {'length':0, 'item':nop, 'contains':nop, 'add':nop, 'remove':nop, 'toggle':nop}; + Element.prototype.classList = fakeDOMTokenList; + } } + catch (e) {} }); @@ -292,7 +295,7 @@ getCopyOfNode = function(node) { } }; -if (browser.isIE) { +if (browser.isIE7max) { _setAttribute = function(e, name, value) { // workarround IE lack of dom implementation. switch(name.toLowerCase()) { @@ -315,9 +318,10 @@ if (browser.isIE) { } }; var reCompoundPropName = /^\s*([^\-]+)\-([a-z])([a-z]+)\s*$/; - var _capitalizeCssPropName = function (s, g1, g2, g3) { // gN args match above regexp groups - if(g2) { - return g1 + g2.toUpperCase() + g3;} + var _capitalizeCssPropName = function (s) { + var g = reCompoundPropName.exec(s); + if(g) { + return g[1] + g[2].toUpperCase() + g[3];} else { return s;} };