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
aa41aed9
Commit
aa41aed9
authored
May 20, 2013
by
marco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prototype for polyfill on number input fields, minimal styling to up down buttons
parent
b16e17a2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
18 deletions
+14
-18
cms/static/client_templates/metadata_number_entry.html
+1
-1
cms/static/coffee/src/views/module_edit.coffee
+1
-2
cms/static/js/base.js
+3
-10
cms/static/sass/views/_unit.scss
+4
-3
common/static/css/vendor/html5-input-polyfills/number-polyfill.css
+5
-2
common/static/js/vendor/html5-input-polyfills/number-polyfill.js
+0
-0
No files found.
cms/static/client_templates/metadata_number_entry.html
View file @
aa41aed9
<div
class=
"wrapper-comp-setting"
>
<label
class=
"label setting-label"
for=
"<%= uniqueId %>"
><
%=
model
.
get
('
display_name
')
%
></label>
<input
class=
"input setting-input
"
type=
"number"
id=
"<%= uniqueId %>"
value=
'<%= model.get("value") %>'
onkeyup=
"checkNumberSettingValidity(this);
"
/>
<input
class=
"input setting-input
setting-input-number"
type=
"number"
id=
"<%= uniqueId %>"
value=
'<%= model.get("value") %>'
onkeyup=
"checkNumberValidity(this)
"
/>
<button
class=
"action setting-clear inactive"
type=
"button"
name=
"setting-clear"
value=
"Clear"
data-tooltip=
"Clear"
>
<i
class=
"ss-icon ss-symbolicons-block undo"
>
↩
</i><span
class=
"sr"
>
Clear Value
</span>
</button>
...
...
cms/static/coffee/src/views/module_edit.coffee
View file @
aa41aed9
...
...
@@ -30,8 +30,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
});
#Manually runs polyfill for input number types to correct for Firefox non-support
#wrapperSettings = @$el.find(".wrapper-comp-settings")
#wrapperSettings.inputNumber()
#numberPolyfill()
# Need to update set "active" class on data editor if there is one.
# If we are only showing settings, hide the data editor controls and update settings accordingly.
...
...
cms/static/js/base.js
View file @
aa41aed9
...
...
@@ -897,16 +897,9 @@ function saveSetSectionScheduleDate(e) {
});
}
function
checkNumberSettingValidity
(
e
)
{
e
.
preventDefault
();
if
(
!
e
.
checkNumberSettingValidity
())
{
alert
(
"You have invalid input. Correct it!"
);
obj
.
focus
();
$
(
'this'
).
val
(
''
);
}
function
checkNumberValidity
(
e
)
{
e
.
preventDefault
;
$
(
e
).
val
(
$
(
e
).
val
().
match
(
/
\d
*
\.?\d
+/
));
}
cms/static/sass/views/_unit.scss
View file @
aa41aed9
...
...
@@ -619,9 +619,11 @@ body.course.unit {
.wrapper-comp-setting
{
display
:
inline-block
;
width
:
360px
;
min-width
:
300px
;
width
:
45%
;
top
:
0
;
vertical-align
:
top
;
margin-bottom
:
5px
;
}
label
.setting-label
{
...
...
@@ -669,7 +671,7 @@ body.course.unit {
}
input
[
type
=
"number"
]
{
width
:
3
9
%
;
width
:
3
6
%
;
@include
box-shadow
(
0
1px
2px
$shadow-l1
inset
);
&
:active
{
...
...
@@ -720,7 +722,6 @@ body.course.unit {
.tip.setting-help
{
@include
font-size
(
12
);
margin-top
:
5px
;
display
:
inline-block
;
font-color
:
$gray-l6
;
min-width
:
260px
;
...
...
common/static/css/vendor/html5-input-polyfills/number-polyfill.css
View file @
aa41aed9
...
...
@@ -2,8 +2,9 @@
div
.number-spin-btn-container
{
display
:
inline-block
;
position
:
relative
;
vertical-align
:
bottom
;
vertical-align
:
top
;
margin
:
0
;
margin-left
:
3px
;
padding
:
0
;
}
div
.number-spin-btn
{
...
...
@@ -13,9 +14,11 @@ div.number-spin-btn {
border-width
:
2px
;
border-color
:
#ededed
#777777
#777777
#ededed
;
border-style
:
solid
;
background-color
:
#
cccccc
;
background-color
:
#
eeeeee
;
width
:
1.2em
;
}
div
.number-spin-btn
:hover
{
/* added blue hover color */
background-color
:
rgb
(
85
,
151
,
221
);
cursor
:
pointer
;
}
div
.number-spin-btn
:active
{
border-width
:
2px
;
...
...
common/static/js/vendor/html5-input-polyfills/number-polyfill.js
View file @
aa41aed9
This diff is collapsed.
Click to expand it.
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