Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

t/152: Implemented FloatingToolbarView and Template.revert() #156

Merged
merged 29 commits into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
624aa58
(Temp) Improved Template#apply() so it preserves original data. Imple…
oleq Jan 27, 2017
30e9455
View#destroy() should not remove view's #element from DOM.
oleq Jan 27, 2017
98a0331
Code refactoring and docs improvements in Template class.
oleq Jan 27, 2017
c68588f
(TMP) Working draft of FloatingToolbarView.
oleq Jan 27, 2017
aa37943
Docs: Fixes in Template class.
oleq Jan 27, 2017
5b297ad
Improved CC of Template class.
oleq Jan 27, 2017
df62ec5
Template#apply() will extend only style and class attributes.
oleq Feb 2, 2017
703089a
Core–refactoring, massive docs improvements.
oleq Feb 2, 2017
1d5fd3e
[Tests, Docs, Code refac] for FloatingToolbarView.
oleq Feb 2, 2017
5f7f0a2
Made EditableUIView revert its template if #editableElement was passe…
oleq Feb 2, 2017
23a029e
Implemented expandToolbarConfig() and enableToolbarKeyboardFocus() to…
oleq Feb 3, 2017
f38789a
Added styles for FloatingToolbarView.
oleq Feb 3, 2017
8d2b005
Added styles for FloatingToolbarView. Code refac in *ToolbarView styles.
oleq Feb 3, 2017
b1e6a3c
Merge branch 'master' into t/152
oleq Feb 3, 2017
efb8b58
Renamed expandToolbarConfig->getItemsFromConfig.
oleq Feb 15, 2017
d7050ee
Merge branch 'master' into t/152
oleq Feb 15, 2017
eca5642
Created FloatingPanelView class. Moved panels to panel/ directory.
oleq Feb 15, 2017
9256a9a
Added #content collection to FloatingPanelView.
oleq Feb 15, 2017
1311a72
Removed FloatingToolbarView from the codebase. Added FloatingPanelVie…
oleq Feb 15, 2017
191a983
Merge branch 'master' into t/152
oleq Mar 1, 2017
0047487
Moved enableToolbarKeyboardFocus ToolbarView utils to a separate module.
oleq Mar 1, 2017
7b67c79
Merge remote-tracking branch 'origin/master' into t/152
oleq Mar 7, 2017
d40c01b
Renamed EditableUIView#isRendered to EditableUIView#externalElement.
oleq Mar 7, 2017
f3d5395
Docs: Fixed broken links.
oleq Mar 7, 2017
2349d63
Docs: Removed link to protected method from public API.
oleq Mar 7, 2017
c7ba822
Docs: Fixes in Template.
oleq Mar 7, 2017
35347df
Removed unnecessary node presence checks from Template#apply and Temp…
oleq Mar 7, 2017
51830e9
Renamed Template#_revertNode() into #_revertTemplateFromNode().
oleq Mar 7, 2017
e42cf46
Renamed module:ui/template~RenderConfig into module:ui/template~Rende…
oleq Mar 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/editableui/editableuiview.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ export default class EditableUIView extends View {
*/
this.set( 'isFocused', false );

/**
* Indicates whether the view operates on an external {@link #editableElement} or
* rendered it on its own.
*
* @observable
* @member {Boolean} #isRendered
*/
this.set( 'isRendered', !editableElement );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda misleading name, considering the description. You can do better than that :P


/**
* The element which is the main editable element (usually the one with `contentEditable="true"`).
*
Expand All @@ -74,7 +83,7 @@ export default class EditableUIView extends View {
* @returns {Promise}
*/
init() {
if ( this.editableElement ) {
if ( !this.isRendered ) {
this.template.apply( this.editableElement );
} else {
this.editableElement = this.element;
Expand All @@ -87,7 +96,9 @@ export default class EditableUIView extends View {
* @inheritDoc
*/
destroy() {
this.editableElement.contentEditable = false;
if ( !this.isRendered ) {
this.template.revert( this.editableElement );
}

return super.destroy();
}
Expand Down
Loading