Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
b344e400
Commit
b344e400
authored
Sep 26, 2007
by
Nigel McNie
Browse files
Make the cancel button work for all blocks when being configured
parent
8d08b8a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/js/views.js
View file @
b344e400
...
...
@@ -230,14 +230,14 @@ function ViewManager() {
pd
[
getNodeAttribute
(
e
.
src
(),
'
name
'
)]
=
1
;
sendjsonrequest
(
'
blocks.json.php
'
,
pd
,
'
POST
'
,
function
(
data
)
{
var
blockinstance
=
getFirstParentByTagAndClassName
(
button
,
'
div
'
,
'
blockinstance
'
);
var
blockinstanceId
=
blockinstance
.
id
.
substr
(
blockinstance
.
id
.
lastIndexOf
(
'
_
'
)
+
1
);
var
content
=
getFirstElementByTagAndClassName
(
'
div
'
,
'
blockinstance-content
'
,
blockinstance
);
var
oldContent
=
content
.
innerHTML
;
content
.
innerHTML
=
data
.
data
[
'
html
'
];
eval
(
data
.
data
[
'
js
'
]);
// Make the cancel button be supersmart
// TODO fix the id of the cancel button
var
cancelButton
=
$
(
'
cancel_cb_8_action_configureblockinstance_id_8
'
);
var
cancelButton
=
$
(
'
cancel_cb_
'
+
blockinstanceId
+
'
_action_configureblockinstance_id_
'
+
blockinstanceId
);
connect
(
cancelButton
,
'
onclick
'
,
function
(
e
)
{
e
.
stop
();
content
.
innerHTML
=
oldContent
;
...
...
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