diff --git a/admin-dev/themes/template/footer.tpl b/admin-dev/themes/template/footer.tpl index c26ec4a93..5a1d77634 100644 --- a/admin-dev/themes/template/footer.tpl +++ b/admin-dev/themes/template/footer.tpl @@ -48,5 +48,6 @@ {* ajaxBox allows*} {/if} +
diff --git a/classes/AdminController.php b/classes/AdminController.php index bd6dcb706..4576a4d55 100644 --- a/classes/AdminController.php +++ b/classes/AdminController.php @@ -1502,6 +1502,7 @@ class AdminControllerCore extends Controller $this->addJquery(); $this->addjQueryPlugin(array('cluetip', 'hoverIntent')); + $this->addJqueryPlugin('scrollTo'); $this->addJS(array( _PS_JS_DIR_.'admin.js', diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 50e418db0..017c9934b 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -131,15 +131,6 @@ class AdminModulesControllerCore extends AdminController $this->logged_on_addons = true; } - public function setMedia() - { - parent::setMedia(); - $this->addJqueryPlugin('scrollTo'); - } - - - - /* ** Ajax Request Methods ** diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 7e01aba96..d2f502c87 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -139,7 +139,6 @@ class AdminOrdersControllerCore extends AdminController $this->addJS(_PS_JS_DIR_.'admin_order.js'); $this->addJS(_PS_JS_DIR_.'tools.js'); $this->addJqueryPlugin('autocomplete'); - $this->addJqueryPlugin('scrollTo'); } } diff --git a/css/admin.css b/css/admin.css index e0fb6e8d2..9a5d0a12e 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1946,4 +1946,20 @@ ul.connectedSortable li.module_list { right:10px; } +/* ScrollTop */ +div#scrollTop a{ + display:none; + background:url('../img/admin/scroll_top.png'); + width:80px; + height:80px; + position:fixed; + bottom:30px; + right:30px; + border-radius:10px; + opacity:0.2; +} +div#scrollTop a:hover{ + opacity:0.8; +} + diff --git a/img/admin/scroll_top.png b/img/admin/scroll_top.png new file mode 100644 index 000000000..c3f937bad Binary files /dev/null and b/img/admin/scroll_top.png differ diff --git a/js/admin.js b/js/admin.js index 69b4eacff..7ac2e340e 100644 --- a/js/admin.js +++ b/js/admin.js @@ -1000,4 +1000,21 @@ $(document).ready(function(){ if(!isArrowKey(e)) return copyMeta2friendlyURL() }); + + // Adding a button to top + var scroll = $('#scrollTop a'); + var view = $(window); + + scroll.click(function(){ + $.scrollTo('#top_container', 1200, { offset: -100 }); + }); + + view.bind("scroll", function(e) { + var heightView = view.height(); + var btnPlace = scroll.offset().top; + if (heightView < btnPlace) + scroll.show(); + else + scroll.hide(); + }); });