Browse Source

UI-1807: now preventing clicks on categories until the current one is finished loading

4.3
Maxime Roux 10 years ago
parent
commit
424adf752d
10 changed files with 41 additions and 12 deletions
  1. +7
    -3
      app.js
  2. +4
    -2
      submodules/callLogs/callLogs.js
  3. +4
    -1
      submodules/devices/devices.js
  4. +4
    -1
      submodules/featureCodes/featureCodes.js
  5. +3
    -0
      submodules/groups/groups.js
  6. +4
    -1
      submodules/myOffice/myOffice.js
  7. +4
    -2
      submodules/numbers/numbers.js
  8. +3
    -0
      submodules/strategy/strategy.js
  9. +4
    -1
      submodules/users/users.js
  10. +4
    -1
      submodules/vmboxes/vmboxes.js

+ 7
- 3
app.js View File

@ -61,18 +61,22 @@ define(function(require){
var self = this, var self = this,
container = parent.find('.right-content'); container = parent.find('.right-content');
parent.find('.category').on('click', function() {
parent.find('.left-menu').on('click', '.category:not(.loading)', function() {
// Get the ID of the submodule to render // Get the ID of the submodule to render
var $this = $(this), var $this = $(this),
args = { args = {
parent: container
parent: container,
callback: function() {
parent.find('.category').removeClass('loading');
}
}, },
id = $this.attr('id'); id = $this.attr('id');
// Display the category we clicked as active // Display the category we clicked as active
parent parent
.find('.category') .find('.category')
.removeClass('active');
.removeClass('active')
.addClass('loading');
$this.toggleClass('active'); $this.toggleClass('active');
// Empty the main container and then render the submodule content // Empty the main container and then render the submodule content


+ 4
- 2
submodules/callLogs/callLogs.js View File

@ -13,10 +13,10 @@ define(function(require){
callLogsRender: function(args) { callLogsRender: function(args) {
var self = this; var self = this;
self.callLogsRenderContent(args.parent);
self.callLogsRenderContent(args.parent, args.fromDate, args.toDate, args.type, args.callback);
}, },
callLogsRenderContent: function(parent, fromDate, toDate, type) {
callLogsRenderContent: function(parent, fromDate, toDate, type, callback) {
var self = this, var self = this,
template, template,
defaultDateRange = 1, defaultDateRange = 1,
@ -78,6 +78,8 @@ define(function(require){
parent parent
.empty() .empty()
.append(template); .append(template);
callback && callback();
}); });
}, },


+ 4
- 1
submodules/devices/devices.js View File

@ -28,7 +28,8 @@ define(function(require){
var self = this, var self = this,
args = pArgs || {}, args = pArgs || {},
parent = args.parent || $('.right-content'), parent = args.parent || $('.right-content'),
_deviceId = args.deviceId || '';
_deviceId = args.deviceId || '',
callback = args.callback;
self.devicesGetData(function(data) { self.devicesGetData(function(data) {
var dataTemplate = self.devicesFormatListData(data), var dataTemplate = self.devicesFormatListData(data),
@ -60,6 +61,8 @@ define(function(require){
} else { } else {
parent.find('.no-devices-row').css('display', 'none'); parent.find('.no-devices-row').css('display', 'none');
} }
callback && callback();
}); });
}, },


+ 4
- 1
submodules/featureCodes/featureCodes.js View File

@ -54,7 +54,8 @@ define(function(require){
featureCodesRender: function(args) { featureCodesRender: function(args) {
var self = this, var self = this,
parent = args.parent || $('.right-content');
parent = args.parent || $('.right-content'),
callback = args.callback;
self.featureCodesLoadData(function(featureCodesData) { self.featureCodesLoadData(function(featureCodesData) {
var template = $(monster.template(self, 'featureCodes-layout', { featureCodes: self.featureCodesFormatData(featureCodesData) })); var template = $(monster.template(self, 'featureCodes-layout', { featureCodes: self.featureCodesFormatData(featureCodesData) }));
@ -68,6 +69,8 @@ define(function(require){
parent parent
.empty() .empty()
.append(template); .append(template);
callback && callback();
}); });
}, },


+ 3
- 0
submodules/groups/groups.js View File

@ -21,6 +21,7 @@ define(function(require){
args = args || {}, args = args || {},
parent = args.parent || $('.right-content'), parent = args.parent || $('.right-content'),
_groupId = args.groupId, _groupId = args.groupId,
callback = args.callback,
noGroup = true; noGroup = true;
self.groupsRemoveOverlay(); self.groupsRemoveOverlay();
@ -68,6 +69,8 @@ define(function(require){
parent.find('.grid-row.title').css('display', 'block'); parent.find('.grid-row.title').css('display', 'block');
parent.find('.no-groups-row').css('display', 'none'); parent.find('.no-groups-row').css('display', 'none');
} }
callback && callback();
} }
}); });
}, },


+ 4
- 1
submodules/myOffice/myOffice.js View File

@ -28,7 +28,8 @@ define(function(require){
/* My Office */ /* My Office */
myOfficeRender: function(args) { myOfficeRender: function(args) {
var self = this, var self = this,
parent = args.parent || $('.right-content');
parent = args.parent || $('.right-content'),
callback = args.callback;
self.myOfficeLoadData(function(myOfficeData) { self.myOfficeLoadData(function(myOfficeData) {
var dataTemplate = { var dataTemplate = {
@ -112,6 +113,8 @@ define(function(require){
parent parent
.empty() .empty()
.append(template); .append(template);
callback && callback();
}); });
}, },


+ 4
- 2
submodules/numbers/numbers.js View File

@ -13,11 +13,13 @@ define(function(require){
numbersRender: function(args){ numbersRender: function(args){
var self = this, var self = this,
parent = args.parent || $('#ws_content');
parent = args.parent || $('#ws_content'),
callback = args.callback;
monster.pub('common.numbers.render', { monster.pub('common.numbers.render', {
container: parent, container: parent,
viewType: 'pbx'
viewType: 'pbx',
callbackAfterRender: callback
}); });
} }
}; };


+ 3
- 0
submodules/strategy/strategy.js View File

@ -150,6 +150,7 @@ define(function(require){
args = args || {}, args = args || {},
parent = args.parent || $('.right-content'), parent = args.parent || $('.right-content'),
openElement = args.openElement, openElement = args.openElement,
callback = args.callback,
templateData = {}, templateData = {},
template; template;
@ -224,6 +225,8 @@ define(function(require){
}); });
} }
} }
callback && callback();
} }
); );


+ 4
- 1
submodules/users/users.js View File

@ -33,7 +33,8 @@ define(function(require){
args = args || {}, args = args || {},
parent = args.parent || $('.right-content'), parent = args.parent || $('.right-content'),
_userId = args.userId, _userId = args.userId,
_openedTab = args.openedTab;
_openedTab = args.openedTab,
callback = args.callback;
self.usersRemoveOverlay(); self.usersRemoveOverlay();
@ -82,6 +83,8 @@ define(function(require){
args.callback && args.callback(); args.callback && args.callback();
} }
callback && callback();
}); });
}, },


+ 4
- 1
submodules/vmboxes/vmboxes.js View File

@ -19,7 +19,8 @@ define(function(require){
var self = this, var self = this,
args = args || {}, args = args || {},
parent = args.parent || $('.right-content'), parent = args.parent || $('.right-content'),
_voicemailId = args.voicemailId || '';
_voicemailId = args.voicemailId || '',
callback = args.callback;
self.vmboxesGetData(function(data) { self.vmboxesGetData(function(data) {
var dataTemplate = self.vmboxesFormatListData(data), var dataTemplate = self.vmboxesFormatListData(data),
@ -51,6 +52,8 @@ define(function(require){
} else { } else {
parent.find('.no-vmboxes-row').css('display', 'none'); parent.find('.no-vmboxes-row').css('display', 'none');
} }
callback && callback();
}); });
}, },


Loading…
Cancel
Save