vendor/assets/javascripts/textext.core.js in textext-rails-0.1.0 vs vendor/assets/javascripts/textext.core.js in textext-rails-0.2.0

- old
+ new

@@ -1,10 +1,10 @@ /** * jQuery TextExt Plugin - * http://alexgorbatchev.com/textext + * http://textextjs.com * - * @version 1.2.0 + * @version 1.3.1 * @copyright Copyright (C) 2011 Alex Gorbatchev. All rights reserved. * @license MIT License */ (function($, undefined) { @@ -69,11 +69,11 @@ */ function TextExtPlugin() {}; var stringify = (JSON || {}).stringify, slice = Array.prototype.slice, - + p, UNDEFINED = 'undefined', /** * TextExt provides a way to pass in the options to configure the core as well as * each plugin that is being currently used. The jQuery exposed plugin `$().textext()` @@ -800,11 +800,13 @@ plugin = source[name]; if(plugin) { self._plugins[name] = plugin = new plugin(); - self[name] = function() { return plugin; }; + self[name] = (function(plugin) { + return function(){ return plugin; } + })(plugin); initList.push(plugin); $.extend(true, plugin, self.opts(OPT_EXT + '.*'), self.opts(OPT_EXT + '.' + name)); } } @@ -966,21 +968,23 @@ { var self = this, input = self.input(), wrap = self.wrapElement(), container = wrap.parent(), - width = self.originalWidth, + width = self.originalWidth + 'px', height ; self.trigger(EVENT_PRE_INVALIDATE); - height = input.outerHeight(); + height = input.outerHeight() + 'px'; - input.width(width); - wrap.width(width).height(height); - container.height(height); + // using css() method instead of width() and height() here because they don't seem to do the right thing in jQuery 1.8.x + // https://github.com/alexgorbatchev/jquery-textext/issues/74 + input.css({ 'width' : width }); + wrap.css({ 'width' : width, 'height' : height }); + container.css({ 'height' : height }); self.trigger(EVENT_POST_INVALIDATE); }; /** @@ -1074,10 +1078,10 @@ * @id TextExt.getFormData */ p.getFormData = function(keyCode) { var self = this, - data = self.getWeightedEventResponse(EVENT_GET_FORM_DATA, keyCode) + data = self.getWeightedEventResponse(EVENT_GET_FORM_DATA, keyCode || 0) ; self.trigger(EVENT_SET_FORM_DATA , data['form']); self.trigger(EVENT_SET_INPUT_DATA , data['input']); };