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
75b413b5
Commit
75b413b5
authored
Dec 07, 2012
by
Tom Giannattasio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reworked add component steps
parent
22a61cdf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
33 deletions
+42
-33
cms/static/coffee/src/views/unit.coffee
+3
-14
cms/static/sass/_unit.scss
+39
-19
No files found.
cms/static/coffee/src/views/unit.coffee
View file @
75b413b5
...
...
@@ -4,7 +4,6 @@ class CMS.Views.UnitEdit extends Backbone.View
'click .new-component .cancel-button'
:
'closeNewComponent'
'click .new-component-templates .new-component-template a'
:
'saveNewComponent'
'click .new-component-templates .cancel-button'
:
'closeNewComponent'
'click .new-component-button'
:
'showNewComponentForm'
'click .delete-draft'
:
'deleteDraft'
'click .create-draft'
:
'createDraft'
'click .publish-draft'
:
'publishDraft'
...
...
@@ -54,30 +53,20 @@ class CMS.Views.UnitEdit extends Backbone.View
)
)
# New component creation
showNewComponentForm
:
(
event
)
=>
event
.
preventDefault
()
@
$newComponentItem
.
addClass
(
'adding'
)
$
(
event
.
target
).
fadeOut
(
150
)
@
$newComponentItem
.
css
(
'height'
,
@
$newComponentTypePicker
.
outerHeight
())
@
$newComponentTypePicker
.
slideDown
(
250
)
showComponentTemplates
:
(
event
)
=>
event
.
preventDefault
()
type
=
$
(
event
.
currentTarget
).
data
(
'type'
)
@
$newComponentTypePicker
.
fadeOut
(
250
)
@
$
(
".new-component-
#{
type
}
"
).
fadeI
n
(
250
)
@
$newComponentTypePicker
.
slideUp
(
250
)
@
$
(
".new-component-
#{
type
}
"
).
slideDow
n
(
250
)
closeNewComponent
:
(
event
)
=>
event
.
preventDefault
()
@
$newComponentTypePicker
.
slide
Up
(
250
)
@
$newComponentTypePicker
.
slide
Down
(
250
)
@
$newComponentTemplatePickers
.
slideUp
(
250
)
@
$newComponentButton
.
fadeIn
(
250
)
@
$newComponentItem
.
removeClass
(
'adding'
)
@
$newComponentItem
.
find
(
'.rendered-component'
).
remove
()
@
$newComponentItem
.
css
(
'height'
,
@
$newComponentButton
.
outerHeight
())
saveNewComponent
:
(
event
)
=>
event
.
preventDefault
()
...
...
cms/static/sass/_unit.scss
View file @
75b413b5
...
...
@@ -80,33 +80,22 @@
border-radius
:
3px
3px
0
0
;
}
.new-component-type
,
.new-component-template
{
@include
clearfix
;
.new-component-type
{
a
,
li
{
display
:
inline-block
;
}
a
{
position
:
relative
;
display
:
inline-block
;
width
:
100px
;
height
:
100px
;
margin-right
:
10px
;
margin-bottom
:
10px
;
border-radius
:
8px
;
border
:
1px
solid
$darkGreen
;
background
:
$green
;
font-size
:
13px
;
line-height
:
14px
;
color
:
#fff
;
text-align
:
center
;
@include
box-shadow
(
0
1px
1px
rgba
(
0
,
0
,
0
,
.4
)
,
0
1px
0
rgba
(
255
,
255
,
255
,
.4
)
inset
);
@include
transition
(
background-color
.15s
);
&
:hover
{
background
:
$brightGreen
;
}
@include
box-shadow
(
0
1px
1px
rgba
(
0
,
0
,
0
,
.2
)
,
0
1px
0
rgba
(
255
,
255
,
255
,
.4
)
inset
);
.name
{
position
:
absolute
;
...
...
@@ -119,9 +108,43 @@
}
}
.new-component-type
,
.new-component-template
{
@include
clearfix
;
a
{
position
:
relative
;
border
:
1px
solid
$darkGreen
;
background
:
$green
;
color
:
#fff
;
@include
transition
(
background-color
.15s
);
&
:hover
{
background
:
$brightGreen
;
}
}
}
.new-component-template
{
margin-bottom
:
20px
;
li
:first-child
{
a
{
border-radius
:
3px
3px
0
0
;
}
}
li
:last-child
{
a
{
border-radius
:
0
0
3px
3px
;
}
}
a
{
height
:
60px
;
display
:
block
;
padding
:
7px
20px
;
border-bottom
:
none
;
font-weight
:
300
;
}
}
...
...
@@ -136,14 +159,11 @@
.new-component-templates
{
display
:
none
;
position
:
absolute
;
width
:
100%
;
padding
:
20px
;
@include
clearfix
;
.cancel-button
{
@include
blue-button
;
border-color
:
#30649c
;
@include
white-button
;
}
}
}
...
...
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