MDL-43999 Atto : Make image dialogue open on double click of an image.
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
.atto_image_preview {
|
||||
max-width: 150px;
|
||||
max-height: 150px;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.editor_atto_content img {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
Vendored
+16
@@ -192,6 +192,22 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
tags: 'img',
|
||||
tagMatchRequiresAll: false
|
||||
});
|
||||
this.editor.delegate('dblclick', this._handleDoubleClick, 'img', this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a double click on an image.
|
||||
*
|
||||
* @method _handleDoubleClick
|
||||
* @param {EventFacade} e
|
||||
* @private
|
||||
*/
|
||||
_handleDoubleClick: function(e) {
|
||||
var image = e.target;
|
||||
|
||||
var selection = this.get('host').getSelectionFromNode(image);
|
||||
this.get('host').setSelection(selection);
|
||||
this._displayDialogue();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+16
@@ -192,6 +192,22 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
tags: 'img',
|
||||
tagMatchRequiresAll: false
|
||||
});
|
||||
this.editor.delegate('dblclick', this._handleDoubleClick, 'img', this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a double click on an image.
|
||||
*
|
||||
* @method _handleDoubleClick
|
||||
* @param {EventFacade} e
|
||||
* @private
|
||||
*/
|
||||
_handleDoubleClick: function(e) {
|
||||
var image = e.target;
|
||||
|
||||
var selection = this.get('host').getSelectionFromNode(image);
|
||||
this.get('host').setSelection(selection);
|
||||
this._displayDialogue();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -190,6 +190,22 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
|
||||
tags: 'img',
|
||||
tagMatchRequiresAll: false
|
||||
});
|
||||
this.editor.delegate('dblclick', this._handleDoubleClick, 'img', this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a double click on an image.
|
||||
*
|
||||
* @method _handleDoubleClick
|
||||
* @param {EventFacade} e
|
||||
* @private
|
||||
*/
|
||||
_handleDoubleClick: function(e) {
|
||||
var image = e.target;
|
||||
|
||||
var selection = this.get('host').getSelectionFromNode(image);
|
||||
this.get('host').setSelection(selection);
|
||||
this._displayDialogue();
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user