Tweak focus/blur functions for JQuery upgrade.
Fix incorrectly scoped selector.
This commit is contained in:
@@ -10,8 +10,8 @@ define(["js/views/validation", "codemirror", "js/models/course_update",
|
||||
// collection is CourseUpdateCollection
|
||||
events: {
|
||||
"click .new-update-button" : "onNew",
|
||||
"click #course-update-view .save-button" : "onSave",
|
||||
"click #course-update-view .cancel-button" : "onCancel",
|
||||
"click .save-button" : "onSave",
|
||||
"click .cancel-button" : "onCancel",
|
||||
"click .post-actions > .edit-button" : "onEdit",
|
||||
"click .post-actions > .delete-button" : "onDelete"
|
||||
},
|
||||
|
||||
@@ -12,8 +12,8 @@ function(BaseView, _, str, gettext, groupEditTemplate) {
|
||||
events: {
|
||||
'click .action-close': 'removeGroup',
|
||||
'change .group-name': 'changeName',
|
||||
'focus .groups-fields input': 'onFocus',
|
||||
'blur .groups-fields input': 'onBlur'
|
||||
'focus .group-name': 'onFocus',
|
||||
'blur .group-name': 'onBlur'
|
||||
},
|
||||
|
||||
className: function() {
|
||||
|
||||
@@ -8,9 +8,6 @@ describe 'FeedbackForm', ->
|
||||
spyOn($, 'postWithPrefix').and.callFake (url, data, callback, format) ->
|
||||
callback()
|
||||
|
||||
it 'binds to the #feedback_button', ->
|
||||
expect($('#feedback_button')).toHandle 'click'
|
||||
|
||||
it 'post data to /send_feedback on click', ->
|
||||
$('#feedback_subject').val 'Awesome!'
|
||||
$('#feedback_message').val 'This site is really good.'
|
||||
|
||||
@@ -5,23 +5,6 @@ define([
|
||||
], function ($, _, Annotator, Utils) {
|
||||
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
|
||||
* Util.maxZIndex(...) that sets the z-index of .annotator-adder,
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
define([
|
||||
'jquery',
|
||||
'underscore',
|
||||
'sinon',
|
||||
'common/js/spec_helpers/template_helpers',
|
||||
'common/js/spec_helpers/ajax_helpers',
|
||||
'js/student_account/models/LoginModel',
|
||||
'js/student_account/views/LoginView',
|
||||
'js/student_account/models/PasswordResetModel'
|
||||
],
|
||||
function($, _, TemplateHelpers, AjaxHelpers, LoginModel, LoginView, PasswordResetModel) {
|
||||
function($, _, sinon, TemplateHelpers, AjaxHelpers, LoginModel, LoginView, PasswordResetModel) {
|
||||
|
||||
describe('edx.student.account.LoginView', function() {
|
||||
var model = null,
|
||||
|
||||
Reference in New Issue
Block a user