Browse Source

Fix several references to this in proxy to use variable 'element' to avoid keyword issues

pull/1481/head
jlukic 10 years ago
parent
commit
b30779e371
3 changed files with 7 additions and 5 deletions
  1. 2
      RELEASE-NOTES.md
  2. 6
      src/definitions/behaviors/form.js
  3. 4
      src/definitions/behaviors/visit.js

2
RELEASE-NOTES.md

@ -8,6 +8,8 @@
**Enhancement**
- **Dropdown** - Dropdown can now specify which direction a menu should appear left/right, dropdown icons can also appear on the left
- **Dropdown** - Search Dropdown now has a callback when all results filtered ``onNoResults``
- **Dropdown** - Search Dropdown now has input throttling, defaults to `100ms` but can be set with ``delay.search``
- **Table** - Table has now variations to remove responsive stylings, specify responsiveness for tablet
- **Steps** - Steps are now responsive for mobile by default, and have optional responsive styles for tablet
- **Form** - Form will no longer process validation rules on disabled fields

6
src/definitions/behaviors/form.js

@ -375,7 +375,7 @@ $.fn.form = function(fields, parameters) {
if(allValid) {
module.debug('Form has no validation errors, submitting');
module.set.success();
return $.proxy(settings.onSuccess, this)(event);
return $.proxy(settings.onSuccess, element)(event);
}
else {
module.debug('Form has errors');
@ -387,7 +387,7 @@ $.fn.form = function(fields, parameters) {
if($module.data('moduleApi') !== undefined) {
event.stopImmediatePropagation();
}
return $.proxy(settings.onFailure, this)(formErrors);
return $.proxy(settings.onFailure, element)(formErrors);
}
},
@ -445,7 +445,7 @@ $.fn.form = function(fields, parameters) {
if(bracket !== undefined && bracket !== null) {
ancillary = '' + bracket[1];
functionType = type.replace(bracket[0], '');
isValid = $.proxy(settings.rules[functionType], $module)(value, ancillary);
isValid = $.proxy(settings.rules[functionType], element)(value, ancillary);
}
// normal notation
else {

4
src/definitions/behaviors/visit.js

@ -233,10 +233,10 @@ $.visit = $.fn.visit = function(parameters) {
if(settings.limit) {
if(value >= settings.limit) {
module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit);
$.proxy(settings.onLimit, this)(value);
$.proxy(settings.onLimit, element)(value);
}
module.debug('Limit not reached', value, settings.limit);
$.proxy(settings.onChange, this)(value);
$.proxy(settings.onChange, element)(value);
}
module.update.display(value);
}

Loading…
Cancel
Save