mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
8616a45c3c
closes #3939 - Add Seo Tab component to PSM - Add new gh-blur-textarea component - Refactor blur-input to use new text-input mixin
20 lines
673 B
JavaScript
20 lines
673 B
JavaScript
var BlurField = Ember.Mixin.create({
|
|
selectOnClick: false,
|
|
stopEnterKeyDownPropagation: false,
|
|
click: function (event) {
|
|
if (this.get('selectOnClick')) {
|
|
event.currentTarget.select();
|
|
}
|
|
},
|
|
keyDown: function (event) {
|
|
// stop event propagation when pressing "enter"
|
|
// most useful in the case when undesired (global) keyboard shortcuts are getting triggered while interacting
|
|
// with this particular input element.
|
|
if (this.get('stopEnterKeyDownPropagation') && event.keyCode === 13) {
|
|
event.stopPropagation();
|
|
return true;
|
|
}
|
|
}
|
|
});
|
|
|
|
export default BlurField; |