Skip to content

Commit

Permalink
Fire change on root input only when val actually changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Letourneau committed Jun 11, 2012
1 parent 71d8a71 commit 19001ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions javascript/jquery.gwfselect.js
Expand Up @@ -91,10 +91,12 @@
li = $(li).addClass('selected');
var fontName = li.data('fontName');
var styles = this._fontNameToStyle(fontName);
this.element
.val(fontName)
.css(styles)
.trigger('change');
this.element.css(styles);
if (this.element.val() != fontName) {
this.element
.val(fontName)
.trigger('change');
}
this._trigger('change', null, styles);
this._loadFonts([fontName]);
this._toggleFontList(false);
Expand Down

0 comments on commit 19001ae

Please sign in to comment.