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
9fc190dd
Commit
9fc190dd
authored
Apr 25, 2014
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3445 from edx/waheed/stud1514-toggle-cheatsheet-not-working
Added code to remove css on closing cheatsheet.
parents
dead7801
49ef8c56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
cms/static/js/views/modals/edit_xblock.js
+6
-0
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
+14
-2
No files found.
cms/static/js/views/modals/edit_xblock.js
View file @
9fc190dd
...
...
@@ -135,6 +135,12 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal",
var
parent
=
$
(
event
.
target
.
parentElement
),
mode
=
parent
.
data
(
'mode'
);
event
.
preventDefault
();
var
$cheatsheet
=
$
(
'.simple-editor-cheatsheet'
);
if
(
$cheatsheet
.
hasClass
(
"shown"
))
{
$
(
".CodeMirror"
).
removeAttr
(
"style"
);
$
(
".modal-content"
).
removeAttr
(
"style"
);
$cheatsheet
.
removeClass
(
'shown'
);
}
this
.
selectMode
(
mode
);
},
...
...
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
View file @
9fc190dd
...
...
@@ -48,6 +48,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
###
onShowXMLButton
:
(
e
)
=>
e
.
preventDefault
();
@
addRemoveCheatsheetCSS
()
if
@
confirmConversionToXml
()
@
createXMLEditor
(
MarkdownEditingDescriptor
.
markdownToXml
(
@
markdown_editor
.
getValue
()))
# Need to refresh to get line numbers to display properly (and put cursor position to 0)
...
...
@@ -94,11 +95,22 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
@
cheatsheet
=
$
(
$
(
'#simple-editor-cheatsheet'
).
html
())
$
(
@
markdown_editor
.
getWrapperElement
()).
append
(
@
cheatsheet
)
$
(
".CodeMirror"
).
css
({
"overflow"
:
"visible"
})
$
(
".modal-content"
).
css
({
"overflow-y"
:
"visible"
,
"overflow-x"
:
"visible"
})
@
addRemoveCheatsheetCSS
()
setTimeout
(
=>
@
cheatsheet
.
toggleClass
(
'shown'
)),
10
###
Function to add/remove CSS for cheatsheet.
###
addRemoveCheatsheetCSS
:
()
=>
if
!
@
cheatsheet
.
hasClass
(
"shown"
)
$
(
".CodeMirror"
).
css
({
"overflow"
:
"visible"
})
$
(
".modal-content"
).
css
({
"overflow-y"
:
"visible"
,
"overflow-x"
:
"visible"
})
else
$
(
".CodeMirror"
).
removeAttr
(
"style"
)
$
(
".modal-content"
).
removeAttr
(
"style"
)
###
Stores the current editor and hides the one that is not displayed.
###
...
...
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