Skip to content
Permalink
Browse files

Merge pull request #440 from StephaneDiot/EZP-24829_Change_the_displa…

…y_of_the_richtext_focus_mode

EZP-24829: Change the display of the richtext focus mode
  • Loading branch information...
StephaneDiot committed Nov 26, 2015
2 parents d7d0375 + fcdb073 commit aa072be58e54852f8ba23ba5d1eb1176e79049e5
@@ -539,14 +539,10 @@ system:
xmltexteditview-ez-template:
type: 'template'
path: %ez_platformui.public_dir%/templates/fields/edit/xmltext.hbt
ez-richtextfocusmodebarview:
requires: ['ez-barview', 'ez-buttonactionview']
path: %ez_platformui.public_dir%/js/views/ez-richtextfocusmodebarview.js
ez-richtext-editview:
requires:
- 'ez-fieldeditview'
- 'ez-alloyeditor'
- 'ez-richtextfocusmodebarview'
- 'ez-alloyeditor-plugin-embed'
- 'ez-alloyeditor-plugin-addcontent'
- 'ez-alloyeditor-plugin-removeblock'
@@ -32,21 +32,6 @@
background: #f3f3f3;
}

.ez-view-richtexteditview .ez-focusmodeactionbar-container {
background: #333;

display: block;
opacity: 0;
-webkit-transform: translateX(100%);
transform: translateX(100%);
transition: all 0.3s ease;
}

.ez-view-richtexteditview.is-focused .ez-focusmodeactionbar-container {
opacity: 1;
-webkit-transform: translateX(0);
transform: translateX(0);
}

.ez-view-richtexteditview .ez-field-description {
font-weight: lighter;
@@ -45,7 +45,17 @@
}

.ez-view-richtexteditview.is-focused .ez-page-header-name {
display: block;
display: inline-block;
}

.ez-view-richtexteditview .ez-richtext-save-and-return {
display: none;
margin: 0.5em 0 1em 0;
float: right;
}

.ez-view-richtexteditview.is-focused .ez-richtext-save-and-return {
display: inline-block;
}

.ez-view-richtexteditview .ez-editfield-infos {
@@ -64,7 +74,6 @@

.ez-view-richtexteditview.is-focused .ez-editfield-row {
padding-left: 0;
padding-right: 230px;
height: 100%;
}

@@ -73,20 +82,11 @@
overflow-y: auto;
}

.ez-view-richtexteditview .ez-focusmodeactionbar-container {
position: fixed;
top: 0;
right: 0;
width: 230px;
height: 100%;

display: none;
}

.ez-view-richtexteditview.is-focused .ez-focusmodeactionbar-container {
display: block;
}

.ez-view-richtexteditview .ez-field-description {
margin: 0;
}

.ez-view-richtexteditview.is-focused .ez-richtext-input-ui {
box-sizing: border-box;
padding-left: 2em;
}

This file was deleted.

Oops, something went wrong.
@@ -32,6 +32,9 @@ YUI.add('ez-richtext-editview', function (Y) {
events: {
'.ez-richtext-switch-focus': {
'tap': '_setFocusMode',
},
'.ez-richtext-save-and-return': {
'tap': '_unsetFocusMode',
}
},

@@ -49,22 +52,9 @@ YUI.add('ez-richtext-editview', function (Y) {
this.get('editor').destroy();
}
});
this.after('*:saveReturnAction', this._unsetFocusMode);
this.after('focusModeChange', this._uiFocusMode);
},

destructor: function () {
this.get('actionBar').destroy();
},

render: function () {
Y.eZ.RichTextEditView.superclass.render.call(this);
this.get('container').one('.ez-focusmodeactionbar-container').append(
this.get('actionBar').render().get('container')
);
return this;
},

/**
* `focusModeChange` event handler, it adds or removes the focused
* class on the view container.
@@ -95,12 +85,14 @@ YUI.add('ez-richtext-editview', function (Y) {
},

/**
* `saveReturnAction` event handler.
* tap event handler on the save and return button.
*
* @method _unsetFocusMode
* @protected
* @param {EventFacade} e
*/
_unsetFocusMode: function () {
_unsetFocusMode: function (e) {
e.preventDefault();
this._set('focusMode', false);
},

@@ -327,20 +319,6 @@ YUI.add('ez-richtext-editview', function (Y) {
}
}, {
ATTRS: {
/**
* The action bar displayed when in focus mode.
*
* @attribute actionBar
* @type {eZ.RichTextFocusModeBarView}
*/
actionBar: {
valueFn: function () {
return new Y.eZ.RichTextFocusModeBarView({
content: this.get('content'),
bubbleTargets: this,
});
},
},

/**
* Stores the focus mode state. When true, the rich text UI is
@@ -13,6 +13,7 @@
<div class="pure-u ez-editfield-input-area ez-default-error-style">
<div class="ez-editfield-input"><div class="ez-richtext-input-ui">
<h1 class="ez-page-header-name" data-icon="&#xe601;">{{ content.name }} &gt; {{ fieldDefinition.names.[eng-GB] }}</h1>
<button class="pure-button ez-button ez-richtext-save-and-return">Save and Return</button>

<div class="ez-richtext-toolbar">
<button class="pure-button ez-button ez-richtext-switch-focus ez-font-icon ez-button-focus">Focus</button>
@@ -25,4 +26,3 @@
</div></div>
</div>
</div>
<div class="ez-focusmodeactionbar-container"></div>
Oops, something went wrong.

0 comments on commit aa072be

Please sign in to comment.
You can’t perform that action at this time.