Skip to content

Commit

Permalink
fix JS bug@2: click target data bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonweng committed Sep 19, 2017
1 parent 0c20aa3 commit 164f205
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion views/themes/i18n/assets/javascripts/i18n.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions views/themes/i18n/assets/javascripts/i18n/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@

bind: function() {
this.$element.on(EVENT_CLICK, $.proxy(this.click, this)).on(EVENT_CHANGE, $.proxy(this.change, this));

this.$languages.on(EVENT_CHANGE, $.proxy(this.reload, this));
},

unbind: function() {
this.$element.off(EVENT_CLICK, this.click).off(EVENT_CHANGE, this.change);

this.$languages.off(EVENT_CHANGE, this.reload);
this.$element.off(EVENT_CLICK).off(EVENT_CHANGE);
this.$languages.off(EVENT_CHANGE);
},

click: function(e) {
Expand All @@ -99,11 +97,7 @@
}
}

if ($target.data().url) {
return;
}

if (!$target.length) {
if (($target.data() && $target.data().url) || !$target.length) {
return;
}

Expand Down

0 comments on commit 164f205

Please sign in to comment.