Code review feedback--use an arrow function instead of aliasing this

This commit is contained in:
Joe Cheng
2018-09-18 10:52:50 -07:00
parent ef63679ff0
commit 3b62400298
4 changed files with 23 additions and 23 deletions

View File

@@ -115,12 +115,11 @@ $.extend(selectInputBinding, {
$(el).trigger('change');
},
subscribe: function(el, callback) {
var thiz = this;
$(el).on('change.selectInputBinding', function(event) {
$(el).on('change.selectInputBinding', event => {
// https://github.com/rstudio/shiny/issues/2162
// Prevent spurious events that are gonna be squelched in
// a second anyway by the onItemRemove down below
if (el.nonempty && thiz.getValue(el) === "") {
if (el.nonempty && this.getValue(el) === "") {
return;
}
callback();