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
13337178
Commit
13337178
authored
May 10, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message action callbacks have model set to `this`
parent
f5f7cf70
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
cms/static/js/models/feedback.js
+4
-3
cms/static/js/views/feedback.js
+2
-2
cms/templates/base.html
+2
-2
cms/templates/overview.html
+2
-2
No files found.
cms/static/js/models/feedback.js
View file @
13337178
...
...
@@ -13,19 +13,20 @@ CMS.Models.SystemFeedback = Backbone.Model.extend({
"primary": {
"text": "Save",
"class": "action-save",
"click": function(
model
) {
"click": function() {
// do something when Save is clicked
// `this` refers to the model
}
},
"secondary": [
{
"text": "Cancel",
"class": "action-cancel",
"click": function(
model
) {}
"click": function() {}
}, {
"text": "Discard Changes",
"class": "action-discard",
"click": function(
model
) {}
"click": function() {}
}
]
}
...
...
cms/static/js/views/feedback.js
View file @
13337178
...
...
@@ -26,7 +26,7 @@ CMS.Views.SystemFeedback = Backbone.View.extend({
primaryClick
:
function
()
{
var
primary
=
this
.
model
.
get
(
"actions"
).
primary
;
if
(
primary
.
click
)
{
primary
.
click
(
this
.
model
);
primary
.
click
.
call
(
this
.
model
);
}
},
secondaryClick
:
function
(
e
)
{
...
...
@@ -38,7 +38,7 @@ CMS.Views.SystemFeedback = Backbone.View.extend({
var
i
=
_
.
indexOf
(
this
.
$
(
".action-secondary"
),
e
.
target
);
var
secondary
=
this
.
model
.
get
(
"actions"
).
secondary
[
i
];
if
(
secondary
.
click
)
{
secondary
.
click
(
this
.
model
);
secondary
.
click
.
call
(
this
.
model
);
}
}
});
...
...
cms/templates/base.html
View file @
13337178
...
...
@@ -117,8 +117,8 @@ $(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
"actions"
:
{
"primary"
:
{
"text"
:
"Dismiss"
,
"click"
:
function
(
model
)
{
model
.
hide
();
"click"
:
function
()
{
this
.
hide
();
}
}
}
...
...
cms/templates/overview.html
View file @
13337178
...
...
@@ -248,8 +248,8 @@ CMS.Views.SectionEdit = Backbone.View.extend({
actions
:
{
primary
:
{
text
:
"Dismiss"
,
click
:
function
(
model
)
{
model
.
hide
()
click
:
function
()
{
this
.
hide
()
}
}
}
...
...
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