BLD-581: add highlighting of entire field on focus.
This commit is contained in:
@@ -320,12 +320,14 @@ function(BaseView, _, MetadataModel, AbstractEditor, VideoList) {
|
||||
|
||||
Metadata.RelativeTime = AbstractEditor.extend({
|
||||
|
||||
defaultValue : '00:00:00',
|
||||
defaultValue: '00:00:00',
|
||||
// By default max value of RelativeTime field on Backend is 23:59:59,
|
||||
// that is 86399 seconds.
|
||||
maxTimeInSeconds : 86399,
|
||||
maxTimeInSeconds: 86399,
|
||||
|
||||
events : {
|
||||
events: {
|
||||
"focus input" : "addSelection",
|
||||
"mouseup input" : "mouseUpHandler",
|
||||
"change input" : "updateModel",
|
||||
"keypress .setting-input" : "showClearButton" ,
|
||||
"click .setting-clear" : "clear"
|
||||
@@ -333,7 +335,7 @@ function(BaseView, _, MetadataModel, AbstractEditor, VideoList) {
|
||||
|
||||
templateName: "metadata-string-entry",
|
||||
|
||||
getValueFromEditor : function () {
|
||||
getValueFromEditor: function () {
|
||||
var $input = this.$el.find('#' + this.uniqueId);
|
||||
|
||||
return $input.val();
|
||||
@@ -384,18 +386,28 @@ function(BaseView, _, MetadataModel, AbstractEditor, VideoList) {
|
||||
].join(':');
|
||||
},
|
||||
|
||||
setValueInEditor : function (value) {
|
||||
setValueInEditor: function (value) {
|
||||
if (!value) {
|
||||
value = this.defaultValue;
|
||||
}
|
||||
|
||||
this.$el.find('input').val(value);
|
||||
},
|
||||
|
||||
addSelection: function (event) {
|
||||
$(event.currentTarget).select();
|
||||
},
|
||||
|
||||
mouseUpHandler: function (event) {
|
||||
// Prevents default behavior to make works selection in WebKit
|
||||
// browsers
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
Metadata.Dict = AbstractEditor.extend({
|
||||
|
||||
events : {
|
||||
events: {
|
||||
"click .setting-clear" : "clear",
|
||||
"keypress .setting-input" : "showClearButton",
|
||||
"change input" : "updateModel",
|
||||
|
||||
Reference in New Issue
Block a user