[PE mobile] Disable editing text and slide in opensource version
This commit is contained in:
parent
dc46e1b97f
commit
35ea66e440
|
@ -53,7 +53,6 @@ define([
|
|||
// Private
|
||||
var _stack = [],
|
||||
_slideObject = undefined,
|
||||
_themes = [],
|
||||
_themeId = -1,
|
||||
_effect = Asc.c_oAscSlideTransitionTypes.None,
|
||||
_effectType = -1,
|
||||
|
@ -81,6 +80,7 @@ define([
|
|||
uiApp.onPageBack('editslide-effect-type editslide-effect', function (page) {
|
||||
me.initSettings('#edit-slide-transition');
|
||||
});
|
||||
this._themes = [];
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
|
@ -88,7 +88,6 @@ define([
|
|||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
me.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(me.onApiInitEditorStyles, me));
|
||||
me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(me.onApiUpdateThemeIndex, me));
|
||||
},
|
||||
|
||||
|
@ -210,28 +209,15 @@ define([
|
|||
},
|
||||
|
||||
getThemes: function () {
|
||||
return _themes || [];
|
||||
return this._themes || [];
|
||||
},
|
||||
|
||||
// Handlers
|
||||
|
||||
onLayoutClick: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
me.api.ChangeLayout(type);
|
||||
},
|
||||
|
||||
onThemeClick: function (e) {
|
||||
var me = this,
|
||||
$target = $(e.currentTarget),
|
||||
type = $target.data('type');
|
||||
|
||||
$('.container-edit .slide-theme div').removeClass('active');
|
||||
$target.addClass('active');
|
||||
|
||||
me.api.ChangeTheme(type);
|
||||
},
|
||||
|
||||
onRemoveSlide: function () {
|
||||
|
@ -386,35 +372,6 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onApiInitEditorStyles: function(themes) {
|
||||
if (themes) {
|
||||
window.styles_loaded = false;
|
||||
|
||||
var me = this,
|
||||
defaultThemes = themes[0] || [],
|
||||
docThemes = themes[1] || [];
|
||||
|
||||
_themes = [];
|
||||
|
||||
_.each(defaultThemes, function(theme, index) {
|
||||
_themes.push({
|
||||
themeId : theme.get_Index(),
|
||||
offsety : index * 38
|
||||
});
|
||||
});
|
||||
|
||||
_.each(docThemes, function(theme) {
|
||||
_themes.push({
|
||||
imageUrl: theme.get_Image(),
|
||||
themeId : theme.get_Index(),
|
||||
offsety : 0
|
||||
});
|
||||
});
|
||||
|
||||
window.styles_loaded = true;
|
||||
}
|
||||
},
|
||||
|
||||
onApiUpdateThemeIndex: function(themeId) {
|
||||
_themeId = themeId;
|
||||
$('.container-edit .slide-theme .row div').removeClass('active');
|
||||
|
|
|
@ -51,28 +51,12 @@ define([
|
|||
'use strict';
|
||||
|
||||
PE.Controllers.EditText = Backbone.Controller.extend(_.extend((function() {
|
||||
var _fontsArray = [],
|
||||
_stack = [],
|
||||
var _stack = [],
|
||||
_paragraphObject = undefined,
|
||||
_fontInfo = {},
|
||||
_paragraphInfo = {},
|
||||
metricText = Common.Utils.Metric.getCurrentMetricName();
|
||||
|
||||
function onApiLoadFonts(fonts, select) {
|
||||
_.each(fonts, function(font){
|
||||
var fontId = font.asc_getFontId();
|
||||
_fontsArray.push({
|
||||
id : fontId,
|
||||
name : font.asc_getFontName(),
|
||||
// displayValue: font.asc_getFontName(),
|
||||
imgidx : font.asc_getFontThumbnail(),
|
||||
type : font.asc_getFontType()
|
||||
});
|
||||
});
|
||||
|
||||
Common.NotificationCenter.trigger('fonts:load', _fontsArray, select);
|
||||
}
|
||||
|
||||
return {
|
||||
models: [],
|
||||
collections: [],
|
||||
|
@ -90,35 +74,12 @@ define([
|
|||
'font:click': this.onFontClick
|
||||
}
|
||||
});
|
||||
this._fontsArray = [];
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
var me = this;
|
||||
me.api = api;
|
||||
|
||||
me.api.asc_registerCallback('asc_onInitEditorFonts', _.bind(onApiLoadFonts, me));
|
||||
me.api.asc_registerCallback('asc_onFocusObject', _.bind(me.onApiFocusObject, me));
|
||||
me.api.asc_registerCallback('asc_onFontFamily', _.bind(me.onApiChangeFont, me));
|
||||
me.api.asc_registerCallback('asc_onFontSize', _.bind(me.onApiFontSize, me));
|
||||
me.api.asc_registerCallback('asc_onBold', _.bind(me.onApiBold, me));
|
||||
me.api.asc_registerCallback('asc_onItalic', _.bind(me.onApiItalic, me));
|
||||
me.api.asc_registerCallback('asc_onUnderline', _.bind(me.onApiUnderline, me));
|
||||
me.api.asc_registerCallback('asc_onStrikeout', _.bind(me.onApiStrikeout, me));
|
||||
me.api.asc_registerCallback('asc_onVerticalAlign', _.bind(me.onApiVerticalAlign, me));
|
||||
me.api.asc_registerCallback('asc_onTextColor', _.bind(me.onApiTextColor, me));
|
||||
|
||||
me.api.asc_registerCallback('asc_onListType', _.bind(me.onApiBullets, me));
|
||||
me.api.asc_registerCallback('asc_onPrAlign', _.bind(me.onApiParagraphAlign, me));
|
||||
me.api.asc_registerCallback('asc_canIncreaseIndent', _.bind(me.onApiCanIncreaseIndent, me));
|
||||
me.api.asc_registerCallback('asc_canDecreaseIndent', _.bind(me.onApiCanDecreaseIndent, me));
|
||||
me.api.asc_registerCallback('asc_onLineSpacing', _.bind(me.onApiLineSpacing, me));
|
||||
me.api.asc_registerCallback('asc_onVerticalTextAlign', _.bind(me.onApiVerticalTextAlign, me));
|
||||
|
||||
// me.api.asc_registerCallback('asc_onUpdateThemeIndex', _.bind(this.onApiUpdateThemeIndex, this));
|
||||
// me.api.asc_registerCallback('asc_onCanGroup', _.bind(this.onApiCanGroup, this));
|
||||
// me.api.asc_registerCallback('asc_onCanUnGroup', _.bind(this.onApiCanUnGroup, this));
|
||||
// me.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this));
|
||||
// me.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this));
|
||||
},
|
||||
|
||||
onLaunch: function () {
|
||||
|
@ -199,7 +160,7 @@ define([
|
|||
// Public
|
||||
|
||||
getFonts: function() {
|
||||
return _fontsArray;
|
||||
return this._fontsArray;
|
||||
},
|
||||
|
||||
getStack: function() {
|
||||
|
|
Loading…
Reference in a new issue