From 8be405dfe0de3863200327124e8209293e064273 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 17 Dec 2012 06:27:12 -0500 Subject: [PATCH] fixed bug in not fully functional browsers, jquery loaded after ie.js, should be before --- ChangeLog | 3 +++ lib/client.js | 9 +++++---- lib/client/dom.js | 15 +++++++++++++-- lib/client/ie.js | 6 +++--- test/.jshintrc | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07834c91..1eb3dcab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,9 @@ and Util.setTimeout(pFunction [, pCallBack, pTime]) * If choosen upload to -> Gist, and file in json have not '.json' extension, it's added to the and of filename. +* Fixed bug in not fully functional browsers, +jquery loaded after ie.js, should be before. + 2012.12.12, Version 0.1.8 diff --git a/lib/client.js b/lib/client.js index 3d67708e..63fa1851 100644 --- a/lib/client.js +++ b/lib/client.js @@ -238,10 +238,11 @@ CloudClient.init = function(){ if(!document.body.scrollIntoViewIfNeeded){ this.OLD_BROWSER = true; - DOM.jsload(CloudClient.LIBDIRCLIENT + 'ie.js', - function(){ - DOM.jqueryLoad( lFunc ); - }); + var lSrc = CloudClient.LIBDIRCLIENT + 'ie.js'; + + DOM.jqueryLoad( + DOM.retJSLoad(lSrc, lFunc) + ); }else lFunc(); }; diff --git a/lib/client/dom.js b/lib/client/dom.js index 6de8ffaa..8f03bc4e 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -535,7 +535,7 @@ var CloudCommander, Util, DOM, CloudFunc; * @param pFunc */ DOM.jsload = function(pSrc, pFunc){ - if(pSrc instanceof Array){ + if( Util.isArray(pSrc) ){ for(var i=0; i < pSrc.length; i++) pSrc[i].name = 'script'; @@ -549,6 +549,17 @@ var CloudCommander, Util, DOM, CloudFunc; }); }, + /** + * returns jsload functions + */ + DOM.retJSLoad = function(pSrc, pFunc){ + var lRet = function(){ + return DOM.jsload(pSrc, pFunc); + }; + + return lRet; + }, + /** * Функция создаёт елемент style и записывает туда стили * @param pParams_o - структура параметров, заполняеться таким @@ -559,7 +570,7 @@ var CloudCommander, Util, DOM, CloudFunc; pParams_o.name = 'style'; pParams_o.parent = pParams_o.parent || document.head; - return DOM.anyload(pParams_o); + return DOM.anyload(pParams_o); }, /** diff --git a/lib/client/ie.js b/lib/client/ie.js index 45136ac7..89bda3c3 100644 --- a/lib/client/ie.js +++ b/lib/client/ie.js @@ -77,14 +77,14 @@ var Util, DOM, $; https://gist.github.com/2581101 */ centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded; - + var parent = pElement.parentNode, parentComputedStyle = window.getComputedStyle(parent, null), parentBorderTopWidth = - parseInt(parentComputedStyle.getPropertyValue('border-top-width')), + parseInt(parentComputedStyle.getPropertyValue('border-top-width'), 10), parentBorderLeftWidth = - parseInt(parentComputedStyle.getPropertyValue('border-left-width')), + parseInt(parentComputedStyle.getPropertyValue('border-left-width'), 10), overTop = pElement.offsetTop - parent.offsetTop < parent.scrollTop, overBottom = diff --git a/test/.jshintrc b/test/.jshintrc index f648a0a4..071acb2f 100644 --- a/test/.jshintrc +++ b/test/.jshintrc @@ -6,7 +6,7 @@ "es5" : true, "forin" : true, "globalstrict" : true, - "jquery" : true, + "jquery" : false, "newcap" : true, "noarg" : true, "node" : true,