Commit 665f983c by cahrens Committed by Brian Jacobel

Tweak focus/blur functions for JQuery upgrade.

Fix incorrectly scoped selector.
parent 4ba07bf7
...@@ -10,8 +10,8 @@ define(["js/views/validation", "codemirror", "js/models/course_update", ...@@ -10,8 +10,8 @@ define(["js/views/validation", "codemirror", "js/models/course_update",
// collection is CourseUpdateCollection // collection is CourseUpdateCollection
events: { events: {
"click .new-update-button" : "onNew", "click .new-update-button" : "onNew",
"click #course-update-view .save-button" : "onSave", "click .save-button" : "onSave",
"click #course-update-view .cancel-button" : "onCancel", "click .cancel-button" : "onCancel",
"click .post-actions > .edit-button" : "onEdit", "click .post-actions > .edit-button" : "onEdit",
"click .post-actions > .delete-button" : "onDelete" "click .post-actions > .delete-button" : "onDelete"
}, },
......
...@@ -12,8 +12,8 @@ function(BaseView, _, str, gettext, groupEditTemplate) { ...@@ -12,8 +12,8 @@ function(BaseView, _, str, gettext, groupEditTemplate) {
events: { events: {
'click .action-close': 'removeGroup', 'click .action-close': 'removeGroup',
'change .group-name': 'changeName', 'change .group-name': 'changeName',
'focus .groups-fields input': 'onFocus', 'focus .group-name': 'onFocus',
'blur .groups-fields input': 'onBlur' 'blur .group-name': 'onBlur'
}, },
className: function() { className: function() {
......
...@@ -8,9 +8,6 @@ describe 'FeedbackForm', -> ...@@ -8,9 +8,6 @@ describe 'FeedbackForm', ->
spyOn($, 'postWithPrefix').and.callFake (url, data, callback, format) -> spyOn($, 'postWithPrefix').and.callFake (url, data, callback, format) ->
callback() callback()
it 'binds to the #feedback_button', ->
expect($('#feedback_button')).toHandle 'click'
it 'post data to /send_feedback on click', -> it 'post data to /send_feedback on click', ->
$('#feedback_subject').val 'Awesome!' $('#feedback_subject').val 'Awesome!'
$('#feedback_message').val 'This site is really good.' $('#feedback_message').val 'This site is really good.'
......
...@@ -6,23 +6,6 @@ define([ ...@@ -6,23 +6,6 @@ define([
var _t = Annotator._t; var _t = Annotator._t;
/** /**
* We currently run JQuery 1.7.2 in Jasmine tests and LMS.
* AnnotatorJS 1.2.9. uses two calls to addBack (in the two functions
* 'isAnnotator' and 'onHighlightMouseover') which was only defined in
* JQuery 1.8.0. In LMS, it works without throwing an error because
* JQuery.UI 1.10.0 adds support to jQuery<1.8 by augmenting '$.fn' with
* that missing function. It is not the case for all Jasmine unit tests,
* so we add it here if necessary.
**/
if (!$.fn.addBack) {
$.fn.addBack = function (selector) {
return this.add(
selector === null ? this.prevObject : this.prevObject.filter(selector)
);
};
}
/**
* The original _setupDynamicStyle uses a very expensive call to * The original _setupDynamicStyle uses a very expensive call to
* Util.maxZIndex(...) that sets the z-index of .annotator-adder, * Util.maxZIndex(...) that sets the z-index of .annotator-adder,
* .annotator-outer, .annotator-notice, .annotator-filter. We set these * .annotator-outer, .annotator-notice, .annotator-filter. We set these
......
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
define([ define([
'jquery', 'jquery',
'underscore', 'underscore',
'sinon',
'common/js/spec_helpers/template_helpers', 'common/js/spec_helpers/template_helpers',
'common/js/spec_helpers/ajax_helpers', 'common/js/spec_helpers/ajax_helpers',
'js/student_account/models/LoginModel', 'js/student_account/models/LoginModel',
'js/student_account/views/LoginView', 'js/student_account/views/LoginView',
'js/student_account/models/PasswordResetModel' 'js/student_account/models/PasswordResetModel'
], ],
function($, _, TemplateHelpers, AjaxHelpers, LoginModel, LoginView, PasswordResetModel) { function($, _, sinon, TemplateHelpers, AjaxHelpers, LoginModel, LoginView, PasswordResetModel) {
describe('edx.student.account.LoginView', function() { describe('edx.student.account.LoginView', function() {
var model = null, var model = null,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment