Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
790d359b
Commit
790d359b
authored
Mar 20, 2014
by
polesye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BLD-581: add highlighting of entire field on focus.
parent
fbe95bfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
cms/static/js/views/metadata.js
+18
-6
No files found.
cms/static/js/views/metadata.js
View file @
790d359b
...
...
@@ -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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment