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
bfb5f333
Commit
bfb5f333
authored
Oct 05, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable save draft button when there is nothing to save
parent
28ea6628
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
cms/static/coffee/src/views/unit.coffee
+21
-2
cms/static/sass/_cms_mixins.scss
+12
-0
No files found.
cms/static/coffee/src/views/unit.coffee
View file @
bfb5f333
...
...
@@ -12,11 +12,15 @@ class CMS.Views.UnitEdit extends Backbone.View
'change #visibility'
:
'setVisibility'
initialize
:
=>
@
visibility
_v
iew
=
new
CMS
.
Views
.
UnitEdit
.
Visibility
(
@
visibility
V
iew
=
new
CMS
.
Views
.
UnitEdit
.
Visibility
(
el
:
@
$
(
'#visibility'
)
model
:
@
model
)
@
visibility_view
.
render
()
@
saveView
=
new
CMS
.
Views
.
UnitEdit
.
SaveDraftButton
(
el
:
@
$
(
'#save-draft'
)
model
:
@
model
)
@
model
.
on
(
'change:state'
,
@
render
)
...
...
@@ -149,7 +153,21 @@ class CMS.Views.UnitEdit extends Backbone.View
class
CMS
.
Views
.
UnitEdit
.
Visibility
extends
Backbone
.
View
initialize
:
=>
@
model
.
on
(
'change:state'
,
@
render
)
@
render
()
render
:
=>
@
$el
.
val
(
@
model
.
get
(
'state'
))
class
CMS
.
Views
.
UnitEdit
.
SaveDraftButton
extends
Backbone
.
View
initialize
:
=>
@
model
.
on
(
'change:children'
,
@
enable
)
@
model
.
on
(
'change:metadata'
,
@
enable
)
@
model
.
on
(
'sync'
,
@
disable
)
@
disable
()
disable
:
=>
@
$el
.
addClass
(
'disabled'
)
enable
:
=>
@
$el
.
removeClass
(
'disabled'
)
\ No newline at end of file
cms/static/sass/_cms_mixins.scss
View file @
bfb5f333
...
...
@@ -16,6 +16,18 @@
@include
box-shadow
(
0
1px
0
rgba
(
255
,
255
,
255
,
.3
)
inset
,
0
0
0
rgba
(
0
,
0
,
0
,
0
));
@include
transition
(
background-color
.15s
,
box-shadow
.15s
);
&
.disabled
{
border
:
1px
solid
$darkGrey
!
important
;
border-radius
:
3px
!
important
;
background
:
$lightGrey
!
important
;
color
:
#fff
!
important
;
pointer-events
:
none
;
cursor
:
none
;
&
:hover
{
box-shadow
:
0
0
0
0
!
important
;
}
}
&
:hover
{
@include
box-shadow
(
0
1px
0
rgba
(
255
,
255
,
255
,
.3
)
inset
,
0
1px
1px
rgba
(
0
,
0
,
0
,
.15
));
}
...
...
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