diff --git a/apps/documenteditor/mobile/app/controller/DocumentHolder.js b/apps/documenteditor/mobile/app/controller/DocumentHolder.js index 125fea79c..374abfbd6 100644 --- a/apps/documenteditor/mobile/app/controller/DocumentHolder.js +++ b/apps/documenteditor/mobile/app/controller/DocumentHolder.js @@ -123,7 +123,7 @@ define([ _view.hideMenu(); DE.getController('AddContainer').showModal(); - DE.getController('AddOther').getView('AddOther').showLink(); + DE.getController('AddOther').getView('AddOther').showLink(false); } else if ('openlink' == eventName) { _.some(_stack, function (item) { if (item.get_ObjectType() == Asc.c_oAscTypeSelectElement.Hyperlink) { @@ -143,7 +143,7 @@ define([ }, onApiShowPopMenu: function(posX, posY) { - if ($('.popover.settings, .popup.settings, .picker-modal.settings').length > 0) { + if ($('.popover.settings, .popup.settings, .picker-modal.settings, .modal.modal-in').length > 0) { return; } diff --git a/apps/documenteditor/mobile/app/controller/add/AddImage.js b/apps/documenteditor/mobile/app/controller/add/AddImage.js index 742a20eae..ff3131bbf 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddImage.js +++ b/apps/documenteditor/mobile/app/controller/add/AddImage.js @@ -43,8 +43,11 @@ define([ 'core', - 'documenteditor/mobile/app/view/add/AddImage' -], function (core) { + 'documenteditor/mobile/app/view/add/AddImage', + 'jquery', + 'underscore', + 'backbone' +], function (core, view, $, _, Backbone) { 'use strict'; DE.Controllers.AddImage = Backbone.Controller.extend(_.extend((function() { diff --git a/apps/documenteditor/mobile/app/controller/add/AddOther.js b/apps/documenteditor/mobile/app/controller/add/AddOther.js index 29b0f526d..5f2768148 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddOther.js +++ b/apps/documenteditor/mobile/app/controller/add/AddOther.js @@ -41,8 +41,11 @@ define([ 'core', - 'documenteditor/mobile/app/view/add/AddOther' -], function (core) { + 'documenteditor/mobile/app/view/add/AddOther', + 'jquery', + 'underscore', + 'backbone' +], function (core, view, $, _, Backbone) { 'use strict'; DE.Controllers.AddOther = Backbone.Controller.extend(_.extend((function() { diff --git a/apps/documenteditor/mobile/app/controller/add/AddShape.js b/apps/documenteditor/mobile/app/controller/add/AddShape.js index 61fcd7ba6..34225ad1d 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddShape.js +++ b/apps/documenteditor/mobile/app/controller/add/AddShape.js @@ -42,8 +42,11 @@ define([ 'core', - 'documenteditor/mobile/app/view/add/AddShape' -], function (core) { + 'documenteditor/mobile/app/view/add/AddShape', + 'jquery', + 'underscore', + 'backbone' +], function (core, view, $, _, Backbone) { 'use strict'; DE.Controllers.AddShape = Backbone.Controller.extend(_.extend((function() { diff --git a/apps/documenteditor/mobile/app/controller/add/AddTable.js b/apps/documenteditor/mobile/app/controller/add/AddTable.js index be729f5e5..bd7aad589 100644 --- a/apps/documenteditor/mobile/app/controller/add/AddTable.js +++ b/apps/documenteditor/mobile/app/controller/add/AddTable.js @@ -43,8 +43,11 @@ define([ 'core', - 'documenteditor/mobile/app/view/add/AddTable' -], function (core) { + 'documenteditor/mobile/app/view/add/AddTable', + 'jquery', + 'underscore', + 'backbone' +], function (core, view, $, _, Backbone) { 'use strict'; DE.Controllers.AddTable = Backbone.Controller.extend(_.extend((function() { @@ -60,6 +63,12 @@ define([ initialize: function () { Common.NotificationCenter.on('addcontainer:show', _.bind(this.initEvents, this)); + + this.addListeners({ + 'AddTable': { + 'view:render' : this.onViewRender + } + }); }, setApi: function (api) { @@ -83,7 +92,11 @@ define([ me.api.asc_GetDefaultTableStyles(); } - $('#add-table li').single('click', _.buffered(me.onStyleClick, 100, me)); + $('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this)); + }, + + onViewRender: function () { + $('#add-table li').single('click', _.buffered(this.onStyleClick, 100, this)); }, onStyleClick: function (e) { diff --git a/apps/documenteditor/mobile/app/view/add/AddOther.js b/apps/documenteditor/mobile/app/view/add/AddOther.js index ae65a239b..551a1d7aa 100644 --- a/apps/documenteditor/mobile/app/view/add/AddOther.js +++ b/apps/documenteditor/mobile/app/view/add/AddOther.js @@ -98,7 +98,7 @@ define([ // }, - showPage: function (templateId) { + showPage: function (templateId, animate) { var rootView = DE.getController('AddContainer').rootView; if (rootView && this.layout) { @@ -110,7 +110,8 @@ define([ } rootView.router.load({ - content: $content.html() + content: $content.html(), + animatePages: animate !== false }); this.fireEvent('page:show', [this, templateId]); @@ -121,8 +122,8 @@ define([ this.showPage('#addother-sectionbreak'); }, - showLink: function () { - this.showPage('#addother-link'); + showLink: function (animate) { + this.showPage('#addother-link', animate); $('.page[data-page=addother-link] input[type=url]').single('input', _.bind(function(e) { $('#add-link-insert').toggleClass('disabled', _.isEmpty($('#add-link-url input').val())); diff --git a/apps/documenteditor/mobile/app/view/add/AddTable.js b/apps/documenteditor/mobile/app/view/add/AddTable.js index d5ac8f522..d13b5ae2d 100644 --- a/apps/documenteditor/mobile/app/view/add/AddTable.js +++ b/apps/documenteditor/mobile/app/view/add/AddTable.js @@ -82,6 +82,8 @@ define([ $tableStyles.replaceWith(this.layout.find('#add-table-root').html()); } + this.fireEvent('view:render', this); + return this; }, diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js index 13219758f..7c615a11c 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditCell.js @@ -103,7 +103,7 @@ define([ me.api.asc_registerCallback('asc_onInitEditorFonts', _.bind(onApiLoadFonts, me)); me.api.asc_registerCallback('asc_onSelectionChanged', _.bind(me.onApiSelectionChanged, me)); me.api.asc_registerCallback('asc_onEditorSelectionChanged', _.bind(me.onApiEditorSelectionChanged, me)); - me.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(me.onApiInitEditorStyles, me)); // TODO: It does not work until the error in the SDK + me.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(me.onApiInitEditorStyles, me)); }, setMode: function (mode) {