From 6c872d1e83760802d50b86f4315d08d008b16b59 Mon Sep 17 00:00:00 2001 From: 4Giedrius <4giedrius@gmail.com> Date: Mon, 23 Feb 2015 16:14:59 +0200 Subject: [PATCH 1/2] Huraga order popup fixed #272 --- .../html_client/mod_orderbutton_js.phtml | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml index 309388d58..02a4c3ef4 100644 --- a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml +++ b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml @@ -170,25 +170,6 @@ this.createIframe(); } }; - - docReady(function() { - if (typeof jQuery === "undefined") { - (function(d, script) { - script = d.createElement('script'); - script.type = 'text/javascript'; - script.async = true; - script.onload = function(){ - ob = new orderbutton(); - ob.attachEvents(); - }; - script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'; - d.getElementsByTagName('head')[0].appendChild(script); - }(document)); - }else{ - ob = new orderbutton(); - ob.attachEvents(); - } - }); (function(funcName, baseObj) { // The public function name defaults to window.docReady // but you can pass in your own object and own function name and those will be used @@ -258,3 +239,22 @@ } } })("docReady", window); + + docReady(function() { + if (typeof jQuery === "undefined") { + (function(d, script) { + script = d.createElement('script'); + script.type = 'text/javascript'; + script.async = true; + script.onload = function(){ + ob = new orderbutton(); + ob.attachEvents(); + }; + script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'; + d.getElementsByTagName('head')[0].appendChild(script); + }(document)); + }else{ + ob = new orderbutton(); + ob.attachEvents(); + } + }); \ No newline at end of file From aa6d0c6699e62b95438c4efa2018a605a883f696 Mon Sep 17 00:00:00 2001 From: 4Giedrius <4giedrius@gmail.com> Date: Mon, 23 Feb 2015 16:23:04 +0200 Subject: [PATCH 2/2] Fix order popup on window resize --- .../Orderbutton/html_client/mod_orderbutton_js.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml index 02a4c3ef4..99bfc44f0 100644 --- a/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml +++ b/src/bb-modules/Orderbutton/html_client/mod_orderbutton_js.phtml @@ -108,8 +108,8 @@ var pWidth = jQuery(window).width(); var pTop = jQuery(window).scrollTop(); var eWidth = _this.iframeElem.width(); - this.iframeElem.css('top', pTop + 100 + 'px'); - this.iframeElem.css('left', parseInt((pWidth / 2) - (eWidth / 2)) + 'px'); + _this.iframeElem.css('top', pTop + 100 + 'px'); + _this.iframeElem.css('left', parseInt((pWidth / 2) - (eWidth / 2)) + 'px'); }); };