diff --git a/apps/documenteditor/mobile/app/controller/add/AddTable.js b/apps/documenteditor/mobile/app/controller/add/AddTable.js index bd9b464ee..ea3afb806 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddTable.js +++ b/apps/documenteditor/mobile/app/controller/add/AddTable.js @@ -92,11 +92,11 @@ define([ me.api.asc_GetDefaultTableStyles(); } - $('#add-table li').single('click', _.buffered(this.onStyleClick, 300, this)); + $('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this)); }, onViewRender: function () { - $('#add-table li').single('click', _.buffered(this.onStyleClick, 300, this)); + $('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this)); }, onStyleClick: function (e) { @@ -104,64 +104,66 @@ define([ $target = $(e.currentTarget), type = $target.data('type'); + if ($('.modal.modal-in').length > 0) { + return + } + DE.getController('AddContainer').hideModal(); - _.delay(function () { - if ($target) { - var picker; - var modal = uiApp.modal({ - title: me.textTableSize, - text: '', - afterText: - '
' + - '
' + - '
' + me.textColumns + '
' + - '
' + me.textRows + '
' + - '
' + - '
' + - '
', - buttons: [ - { - text: me.textCancel - }, - { - text: 'OK', - bold: true, - onClick: function () { - var size = picker.value; + if ($target) { + var picker; + var modal = uiApp.modal({ + title: me.textTableSize, + text: '', + afterText: + '
' + + '
' + + '
' + me.textColumns + '
' + + '
' + me.textRows + '
' + + '
' + + '
' + + '
', + buttons: [ + { + text: me.textCancel + }, + { + text: 'OK', + bold: true, + onClick: function () { + var size = picker.value; - if (me.api) { - me.api.put_Table(parseInt(size[0]), parseInt(size[1])); + if (me.api) { + me.api.put_Table(parseInt(size[0]), parseInt(size[1])); - var properties = new Asc.CTableProp(); - properties.put_TableStyle(type); + var properties = new Asc.CTableProp(); + properties.put_TableStyle(type); - me.api.tblApply(properties); - } + me.api.tblApply(properties); } } - ] - }); + } + ] + }); - picker = uiApp.picker({ - container: '#picker-table-size', - toolbar: false, - rotateEffect: true, - value: [3, 3], - cols: [{ - textAlign: 'left', - values: [1,2,3,4,5,6,7,8,9,10] - }, { - values: [1,2,3,4,5,6,7,8,9,10] - }] - }); + picker = uiApp.picker({ + container: '#picker-table-size', + toolbar: false, + rotateEffect: true, + value: [3, 3], + cols: [{ + textAlign: 'left', + values: [1,2,3,4,5,6,7,8,9,10] + }, { + values: [1,2,3,4,5,6,7,8,9,10] + }] + }); - // Vertical align - $$(modal).css({ - marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' - }); - } - }, 300); + // Vertical align + $$(modal).css({ + marginTop: - Math.round($$(modal).outerHeight() / 2) + 'px' + }); + } }, // Public