vendor/assets/javascripts/messenger.js in messengerjs-rails-1.4.0 vs vendor/assets/javascripts/messenger.js in messengerjs-rails-1.4.1

- old
+ new

@@ -1,6 +1,6 @@ -/*! messenger 1.4.0 */ +/*! messenger 1.4.1 */ /* * This file begins the output concatenated into messenger.js * * It establishes the Messenger object while preserving whatever it was before * (for noConflict), and making it a callable function. @@ -407,11 +407,12 @@ return _Message.__super__.constructor.apply(this, arguments); } _Message.prototype.defaults = { hideAfter: 10, - scroll: true + scroll: true, + closeButtonText: "&times;" }; _Message.prototype.initialize = function(opts) { if (opts == null) { opts = {}; @@ -572,11 +573,12 @@ _Message.prototype.template = function(opts) { var $action, $actions, $cancel, $link, $message, $text, action, _i, _len, _ref2, _this = this; $message = $("<div class='messenger-message message alert " + opts.type + " message-" + opts.type + " alert-" + opts.type + "'>"); if (opts.showCloseButton) { - $cancel = $('<button type="button" class="messenger-close" data-dismiss="alert">&times;</button>'); + $cancel = $('<button type="button" class="messenger-close" data-dismiss="alert">'); + $cancel.html(opts.closeButtonText); $cancel.click(function() { _this.cancel(); return true; }); $message.append($cancel); @@ -1099,11 +1101,13 @@ delete msgOpts.actions.cancel; delete m_opts._retryActions; } msg.update(msgOpts); if (responseOpts && msgOpts.message) { - Messenger(); + Messenger(_.extend({}, _this.options, { + instance: _this + })); return msg.show(); } else { return msg.hide(); } }; @@ -1233,10 +1237,10 @@ $el = $('<ul>'); $parent.prepend($el); inst = $el.messenger(opts); inst._location = chosen_loc; Messenger.instance = inst; - } else if ($(inst._location) !== $(chosen_loc)) { + } else if (!$(inst._location).is($(chosen_loc))) { inst.$el.detach(); $parent.prepend(inst.$el); } } if (inst._addedClasses != null) {