diff --git a/apps/documenteditor/mobile/app/template/EditText.template b/apps/documenteditor/mobile/app/template/EditText.template index 75c5898ef..76080e08e 100644 --- a/apps/documenteditor/mobile/app/template/EditText.template +++ b/apps/documenteditor/mobile/app/template/EditText.template @@ -408,3 +408,19 @@ + + +
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/apps/documenteditor/mobile/app/view/edit/EditText.js b/apps/documenteditor/mobile/app/view/edit/EditText.js index bc299bd80..d131843ed 100644 --- a/apps/documenteditor/mobile/app/view/edit/EditText.js +++ b/apps/documenteditor/mobile/app/view/edit/EditText.js @@ -200,11 +200,46 @@ define([ this.paletteTextColor = new Common.UI.ThemeColorPalette({ el: $('.page[data-page=edit-text-font-color] .page-content') }); + this.paletteTextColor.on('customcolor', function () { + me.showCustomFontColor(); + }); + var template = _.template(['
', + '', + '
'].join('')); + $('.page[data-page=edit-text-font-color] .page-content').append(template({scope: this})); + $('#edit-text-add-custom-color').single('click', _.bind(this.showCustomFontColor, this)); Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-color]', '.page[data-page=edit-text-font-color] .page-content'); this.fireEvent('page:show', [this, '#edit-text-color']); }, + showCustomFontColor: function () { + var me = this, + selector = '#edit-text-custom-color-view'; + me.showPage(selector, true); + + me.customColorPicker = new Common.UI.HsbColorPicker({ + el: $('.page[data-page=edit-text-custom-color] .page-content'), + color: me.paletteTextColor.currentColor + }); + me.customColorPicker.on('addcustomcolor', function (colorPicker, color) { + me.paletteTextColor.addNewDynamicColor(colorPicker, color); + DE.getController('EditContainer').rootView.router.back(); + }); + + me.fireEvent('page:show', [me, selector]); + }, + showBackgroundColor: function () { this.showPage('#edit-text-background', true); @@ -212,11 +247,46 @@ define([ el: $('.page[data-page=edit-text-font-background] .page-content'), transparent: true }); + this.paletteBackgroundColor.on('customcolor', function () { + me.showCustomBackgroundColor(); + }); + var template = _.template(['
', + '', + '
'].join('')); + $('.page[data-page=edit-text-font-background] .page-content').append(template({scope: this})); + $('#edit-text-add-custom-background-color').single('click', _.bind(this.showCustomBackgroundColor, this)); Common.Utils.addScrollIfNeed('.page[data-page=edit-text-font-background]', '.page[data-page=edit-text-font-background] .page-content'); this.fireEvent('page:show', [this, '#edit-text-background']); }, + showCustomBackgroundColor: function () { + var me = this, + selector = '#edit-text-custom-color-view'; + me.showPage(selector, true); + + me.customBackgroundColorPicker = new Common.UI.HsbColorPicker({ + el: $('.page[data-page=edit-text-custom-color] .page-content'), + color: me.paletteBackgroundColor.currentColor + }); + me.customBackgroundColorPicker.on('addcustomcolor', function (colorPicker, color) { + me.paletteBackgroundColor.addNewDynamicColor(colorPicker, color); + DE.getController('EditContainer').rootView.router.back(); + }); + + me.fireEvent('page:show', [me, selector]); + }, + showAdditional: function () { this.showPage('#edit-text-additional'); Common.Utils.addScrollIfNeed('.page[data-page=edit-text-additional]', '.page[data-page=edit-text-additional] .page-content'); @@ -259,7 +329,9 @@ define([ textCharacterBold: 'B', textCharacterItalic: 'I', textCharacterUnderline: 'U', - textCharacterStrikethrough: 'S' + textCharacterStrikethrough: 'S', + textAddCustomColor: 'Add Custom Color', + textCustomColor: 'Custom Color' } })(), DE.Views.EditText || {})) }); \ No newline at end of file