From 6ed79dec7a93366068aafc0ceb1903f29067a493 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 1 Dec 2016 14:14:25 +0300 Subject: [PATCH] [PE mobile] Fixed display default table styles. --- .../mobile/app/controller/add/AddTable.js | 10 +++++++--- .../mobile/app/controller/edit/EditContainer.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/mobile/app/controller/add/AddTable.js b/apps/presentationeditor/mobile/app/controller/add/AddTable.js index e87adbe87..1a081b672 100644 --- a/apps/presentationeditor/mobile/app/controller/add/AddTable.js +++ b/apps/presentationeditor/mobile/app/controller/add/AddTable.js @@ -48,7 +48,8 @@ define([ 'use strict'; PE.Controllers.AddTable = Backbone.Controller.extend(_.extend((function() { - var _styles = []; + var _styles = [], + _initDefaultStyles = false; return { models: [], @@ -75,8 +76,11 @@ define([ initEvents: function () { var me = this; - if (_styles.length < 1) { - me.api.asc_GetDefaultTableStyles(); + if (!_initDefaultStyles) { + _initDefaultStyles = true; + _styles = []; + + me.api.asc_GetDefaultTableStyles && me.api.asc_GetDefaultTableStyles(); } $('#add-table li').single('click', _.buffered(me.onStyleClick, 100, me)); diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js b/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js index d985383f9..afaafddb1 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditContainer.js @@ -194,7 +194,7 @@ define([ $layoutNavbar .find('.center') .removeClass('categories') - .html(layoutEditors[0].caption); + .html(layoutEditors.length>0 ? layoutEditors[0].caption: ''); } else { if (isAndroid) { $layoutNavbar