diff --git a/apps/presentationeditor/mobile/app/controller/edit/EditSlide.js b/apps/presentationeditor/mobile/app/controller/edit/EditSlide.js index b44e68185..a96eb4c51 100644 --- a/apps/presentationeditor/mobile/app/controller/edit/EditSlide.js +++ b/apps/presentationeditor/mobile/app/controller/edit/EditSlide.js @@ -53,6 +53,7 @@ define([ // Private var _stack = [], _slideObject = undefined, + _slideLayoutIndex = -1, _themes = [], _themeId = -1, _effect = Asc.c_oAscSlideTransitionTypes.None, @@ -121,7 +122,8 @@ define([ paletteFillColor && paletteFillColor.on('select', _.bind(me.onFillColor, me)); } else if (pageId == '#edit-slide-layout') { - $('.container-edit .slide-layout li').single('click', _.buffered(me.onLayoutClick, 100, me)); + $('.container-edit .slide-layout li').removeClass('active').single('click', _.buffered(me.onLayoutClick, 100, me)); + $('.container-edit .slide-layout li[data-type=' + _slideLayoutIndex + ']').addClass('active'); } else if (pageId == '#edit-slide-theme') { this.getView('EditSlide').renderThemes(); @@ -220,6 +222,9 @@ define([ $target = $(e.currentTarget), type = $target.data('type'); + $('.container-edit .slide-layout li').removeClass('active'); + $target.addClass('active'); + me.api.ChangeLayout(type); }, @@ -267,6 +272,7 @@ define([ updateLayouts: function(layouts){ this.getView('EditSlide').updateLayouts(); $('.container-edit .slide-layout li').single('click', _.buffered(this.onLayoutClick, 100, this)); + $('.container-edit .slide-layout li[data-type=' + _slideLayoutIndex + ']').addClass('active'); }, onEffectClick: function (e) { @@ -381,6 +387,11 @@ define([ if (slides.length > 0) { var object = slides[slides.length - 1]; // get top slide _slideObject = object.get_ObjectValue(); + _slideLayoutIndex = _slideObject.get_LayoutIndex(); + if ($('.container-edit .slide-layout').length > 0) { + $('.container-edit .slide-layout li').removeClass('active'); + $('.container-edit .slide-layout li[data-type=' + _slideLayoutIndex + ']').addClass('active'); + } } else { _slideObject = undefined; }