Skip to content

Commit 20a11e3

Browse files
committed
adds loader when user has to wait
1 parent e020d15 commit 20a11e3

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

cms/static/cms/css/plugins/cms.toolbar.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cms/static/cms/js/plugins/cms.placeholders.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,9 @@ $(document).ready(function () {
708708
e.preventDefault();
709709
e.stopPropagation();
710710

711+
// show loader
712+
CMS.API.Toolbar._showLoader(true);
713+
711714
var el = $(this);
712715

713716
// set switch for subnav entries
@@ -721,10 +724,11 @@ $(document).ready(function () {
721724
case 'copy':
722725
that.copyPlugin();
723726
break;
724-
case 'stack':
725-
// that.stackPlugin();
726-
break;
727+
/*case 'stack':
728+
//that.stackPlugin();
729+
break;*/
727730
default:
731+
CMS.API.Toolbar._showLoader(false);
728732
that._delegate(el);
729733
}
730734
});
@@ -843,10 +847,6 @@ $(document).ready(function () {
843847
}
844848
},
845849

846-
_updateExpander: function () {
847-
848-
},
849-
850850
_getId: function (el) {
851851
return CMS.API.Placeholders.getId(el);
852852
},

cms/static/cms/js/plugins/cms.toolbar.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,9 @@ $(document).ready(function () {
521521
},
522522

523523
openModal: function (url, name, breadcrumb) {
524+
// show loader
525+
this._showLoader(true);
526+
524527
// reset breadcrumb
525528
this.modal.find('.cms_modal-breadcrumb').hide();
526529
this.modal.find('.cms_modal-breadcrumb-items').html('');
@@ -890,6 +893,9 @@ $(document).ready(function () {
890893
$(document).bind('keydown.cms', function (e) {
891894
if(e.keyCode === 27) that.closeModal();
892895
});
896+
897+
// hide loader
898+
this._showLoader(false);
893899
},
894900

895901
_hideModal: function (speed) {
@@ -1259,6 +1265,14 @@ $(document).ready(function () {
12591265
}
12601266
},
12611267

1268+
_showLoader: function (loader) {
1269+
if(loader) {
1270+
this.toolbarTrigger.addClass('cms_toolbar-loader');
1271+
} else {
1272+
this.toolbarTrigger.removeClass('cms_toolbar-loader');
1273+
}
1274+
},
1275+
12621276
_debug: function () {
12631277
var that = this;
12641278
var timeout = 1000;

cms/static/cms/sass/plugins/cms.toolbar.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,12 @@
389389
&:hover, &:active, &:focus { background-position:-90px -40px; background-color:white; }
390390
}
391391
}
392+
// #TOOLBAR/loader#
392393
.cms_toolbar-trigger-expanded a { background-position:0 -40px;
393394
&:hover, &:active, &:focus { background-position:-30px -40px; }
394395
}
396+
.cms_toolbar-loader a { background:#fcfcfc url('../../img/loader.gif') no-repeat center center !important;
397+
background-size:20px 20px !important; }
395398

396399
// #TOOLBAR/switch#
397400
.cms_toolbar-item_switch { position:relative; left:0; top:0; margin:4px 0 4px; @include border-radius(20px);

0 commit comments

Comments
 (0)