Commit 848e27bb authored by Alexander Yuzhin's avatar Alexander Yuzhin

[SE mobile] Add EditContainer.

parent 3a1e43e5
...@@ -40,8 +40,11 @@ ...@@ -40,8 +40,11 @@
* *
*/ */
define([ define([
'core' 'core',
], function (core) { 'jquery',
'underscore',
'backbone'
], function (core, $, _, Backbone) {
'use strict'; 'use strict';
DE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() { DE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() {
...@@ -108,7 +111,7 @@ define([ ...@@ -108,7 +111,7 @@ define([
var me = this, var me = this,
editors = []; editors = [];
if (_settings.length < 0) { if (_settings.length < 1) {
editors.push(me._emptyEditController()); editors.push(me._emptyEditController());
} else { } else {
if (_.contains(_settings, 'text')) { if (_.contains(_settings, 'text')) {
......
...@@ -108,7 +108,7 @@ define([ ...@@ -108,7 +108,7 @@ define([
var me = this, var me = this,
editors = []; editors = [];
if (_settings.length < 0) { if (_settings.length < 1) {
editors.push(me._emptyEditController()); editors.push(me._emptyEditController());
} else { } else {
if (_.contains(_settings, 'slide')) { if (_.contains(_settings, 'slide')) {
......
...@@ -122,7 +122,7 @@ require([ ...@@ -122,7 +122,7 @@ require([
, 'CellEditor' , 'CellEditor'
, 'Statusbar' , 'Statusbar'
,'Settings' ,'Settings'
// ,'EditContainer' ,'EditContainer'
// ,'EditText' // ,'EditText'
// ,'EditParagraph' // ,'EditParagraph'
// ,'EditTable' // ,'EditTable'
...@@ -192,7 +192,7 @@ require([ ...@@ -192,7 +192,7 @@ require([
, 'spreadsheeteditor/mobile/app/controller/CellEditor' , 'spreadsheeteditor/mobile/app/controller/CellEditor'
, 'spreadsheeteditor/mobile/app/controller/Statusbar' , 'spreadsheeteditor/mobile/app/controller/Statusbar'
, 'spreadsheeteditor/mobile/app/controller/Settings' , 'spreadsheeteditor/mobile/app/controller/Settings'
// ,'spreadsheeteditor/mobile/app/controller/edit/EditContainer' ,'spreadsheeteditor/mobile/app/controller/edit/EditContainer'
// ,'spreadsheeteditor/mobile/app/controller/edit/EditText' // ,'spreadsheeteditor/mobile/app/controller/edit/EditText'
// ,'spreadsheeteditor/mobile/app/controller/edit/EditParagraph' // ,'spreadsheeteditor/mobile/app/controller/edit/EditParagraph'
// ,'spreadsheeteditor/mobile/app/controller/edit/EditTable' // ,'spreadsheeteditor/mobile/app/controller/edit/EditTable'
......
...@@ -33,18 +33,21 @@ ...@@ -33,18 +33,21 @@
/** /**
* EditContainer.js * EditContainer.js
* Document Editor * Spreadsheet Editor
* *
* Created by Alexander Yuzhin on 9/27/16 * Created by Alexander Yuzhin on 12/6/16
* Copyright (c) 2016 Ascensio System SIA. All rights reserved. * Copyright (c) 2016 Ascensio System SIA. All rights reserved.
* *
*/ */
define([ define([
'core' 'core',
], function (core) { 'jquery',
'underscore',
'backbone'
], function (core, $, _, Backbone) {
'use strict'; 'use strict';
DE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() { SSE.Controllers.EditContainer = Backbone.Controller.extend(_.extend((function() {
// Private // Private
var _settings = []; var _settings = [];
...@@ -68,7 +71,7 @@ define([ ...@@ -68,7 +71,7 @@ define([
showModal: function() { showModal: function() {
var me = this, var me = this,
mainView = DE.getController('Editor').getView('Editor').f7View, mainView = SSE.getController('Editor').getView('Editor').f7View,
isAndroid = Framework7.prototype.device.android === true; isAndroid = Framework7.prototype.device.android === true;
if ($$('.container-edit.modal-in').length > 0) { if ($$('.container-edit.modal-in').length > 0) {
...@@ -81,7 +84,7 @@ define([ ...@@ -81,7 +84,7 @@ define([
me._showByStack(Common.SharedSettings.get('phone')); me._showByStack(Common.SharedSettings.get('phone'));
DE.getController('Toolbar').getView('Toolbar').hideSearch(); SSE.getController('Toolbar').getView('Toolbar').hideSearch();
}, },
hideModal: function () { hideModal: function () {
...@@ -108,56 +111,49 @@ define([ ...@@ -108,56 +111,49 @@ define([
var me = this, var me = this,
editors = []; editors = [];
if (_settings.length < 0) { if (_settings.length < 1) {
editors.push(me._emptyEditController()); editors.push(me._emptyEditController());
} else { } else {
if (_.contains(_settings, 'text')) { if (_.contains(_settings, 'cell')) {
editors.push({ editors.push({
caption: me.textText, caption: me.textCell,
id: 'edit-text', id: 'edit-cell',
layout: DE.getController('EditText').getView('EditText').rootLayout() layout: SSE.getController('EditCell').getView('EditCell').rootLayout()
})
}
if (_.contains(_settings, 'paragraph')) {
editors.push({
caption: me.textParagraph,
id: 'edit-paragraph',
layout: DE.getController('EditParagraph').getView('EditParagraph').rootLayout()
}) })
} }
if (_.contains(_settings, 'table')) { if (_.contains(_settings, 'table')) {
editors.push({ editors.push({
caption: me.textTable, caption: me.textTable,
id: 'edit-table', id: 'edit-table',
layout: DE.getController('EditTable').getView('EditTable').rootLayout() layout: SSE.getController('EditTable').getView('EditTable').rootLayout()
}) })
} }
if (_.contains(_settings, 'shape')) { if (_.contains(_settings, 'shape')) {
editors.push({ editors.push({
caption: me.textShape, caption: me.textShape,
id: 'edit-shape', id: 'edit-shape',
layout: DE.getController('EditShape').getView('EditShape').rootLayout() layout: SSE.getController('EditShape').getView('EditShape').rootLayout()
}) })
} }
if (_.contains(_settings, 'image')) { if (_.contains(_settings, 'image')) {
editors.push({ editors.push({
caption: me.textImage, caption: me.textImage,
id: 'edit-image', id: 'edit-image',
layout: DE.getController('EditImage').getView('EditImage').rootLayout() layout: SSE.getController('EditImage').getView('EditImage').rootLayout()
}) })
} }
if (_.contains(_settings, 'chart')) { if (_.contains(_settings, 'chart')) {
editors.push({ editors.push({
caption: me.textChart, caption: me.textChart,
id: 'edit-chart', id: 'edit-chart',
layout: DE.getController('EditChart').getView('EditChart').rootLayout() layout: SSE.getController('EditChart').getView('EditChart').rootLayout()
}) })
} }
if (_.contains(_settings, 'hyperlink')) { if (_.contains(_settings, 'hyperlink')) {
editors.push({ editors.push({
caption: me.textHyperlink, caption: me.textHyperlink,
id: 'edit-link', id: 'edit-link',
layout: DE.getController('EditHyperlink').getView('EditHyperlink').rootLayout() layout: SSE.getController('EditHyperlink').getView('EditHyperlink').rootLayout()
}) })
} }
} }
...@@ -167,7 +163,7 @@ define([ ...@@ -167,7 +163,7 @@ define([
_showByStack: function(isPhone) { _showByStack: function(isPhone) {
var me = this, var me = this,
mainView = DE.getController('Editor').getView('Editor').f7View, mainView = SSE.getController('Editor').getView('Editor').f7View,
isAndroid = Framework7.prototype.device.android === true, isAndroid = Framework7.prototype.device.android === true,
layoutEditors = me._layoutEditorsByStack(); layoutEditors = me._layoutEditorsByStack();
...@@ -350,11 +346,13 @@ define([ ...@@ -350,11 +346,13 @@ define([
} }
_settings = _.uniq(_settings); _settings = _.uniq(_settings);
//TODO: DEBUG ONLY
_settings = [];
}, },
textSettings: 'Settings', textSettings: 'Settings',
textText: 'Text', textCell: 'Cell',
textParagraph: 'Paragraph',
textTable: 'Table', textTable: 'Table',
textShape: 'Shape', textShape: 'Shape',
textImage: 'Image', textImage: 'Image',
...@@ -362,5 +360,5 @@ define([ ...@@ -362,5 +360,5 @@ define([
textHyperlink: 'Hyperlink' textHyperlink: 'Hyperlink'
} }
})(), DE.Controllers.EditContainer || {})) })(), SSE.Controllers.EditContainer || {}))
}); });
\ No newline at end of file
...@@ -124,7 +124,7 @@ define([ ...@@ -124,7 +124,7 @@ define([
// Editor // Editor
showEdition: function () { showEdition: function () {
// SSE.getController('EditContainer').showModal(); SSE.getController('EditContainer').showModal();
}, },
// Inserts // Inserts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment