From 6c60feb23eedf8a13724925956a828fe118f2a97 Mon Sep 17 00:00:00 2001 From: John Martin Date: Thu, 30 Aug 2012 17:22:23 +0100 Subject: [PATCH] Removed custom JavaScript for changing custom fields remove checkbox into a button for IE7 It's basically because IE7 doesn't like calling the change event on input that are not visible. It's not an ideal fix... but it does make the form usable. --- .../base/javascript/modules/custom-fields.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ckan/public/base/javascript/modules/custom-fields.js b/ckan/public/base/javascript/modules/custom-fields.js index d81fab202e6..a68737ddc50 100644 --- a/ckan/public/base/javascript/modules/custom-fields.js +++ b/ckan/public/base/javascript/modules/custom-fields.js @@ -17,14 +17,16 @@ this.ckan.module('custom-fields', function (jQuery, _) { * Returns nothing. */ initialize: function () { - jQuery.proxyAll(this, /_on/); + if (!jQuery.browser.msie || !jQuery.browser.version == '7.0') { + jQuery.proxyAll(this, /_on/); - var delegated = this.options.fieldSelector + ':last input:first'; - this.el.on('change', delegated, this._onChange); - this.el.on('change', ':checkbox', this._onRemove); + var delegated = this.options.fieldSelector + ':last input:first'; + this.el.on('change', delegated, this._onChange); + this.el.on('change', ':checkbox', this._onRemove); - // Style the remove checkbox like a button. - this.$('.checkbox').addClass("btn btn-danger icon-remove"); + // Style the remove checkbox like a button. + this.$('.checkbox').addClass("btn btn-danger icon-remove"); + } }, /* Creates a new field and appends it to the list. This currently works by