mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-05 12:15:14 -05:00
Remove extraneous indenting
This commit is contained in:
@@ -1,49 +1,48 @@
|
||||
// Text input
|
||||
var textInputBinding = new InputBinding();
|
||||
$.extend(textInputBinding, {
|
||||
find: function(scope) {
|
||||
return $(scope).find('input[type="text"], input[type="password"], input[type="search"], input[type="url"], input[type="email"]');
|
||||
},
|
||||
getId: function(el) {
|
||||
return InputBinding.prototype.getId.call(this, el) || el.name;
|
||||
},
|
||||
getValue: function(el) {
|
||||
return el.value;
|
||||
},
|
||||
setValue: function(el, value) {
|
||||
el.value = value;
|
||||
},
|
||||
subscribe: function(el, callback) {
|
||||
$(el).on('keyup.textInputBinding input.textInputBinding', function(event) {
|
||||
callback(true);
|
||||
});
|
||||
$(el).on('change.textInputBinding', function(event) {
|
||||
callback(false);
|
||||
});
|
||||
},
|
||||
unsubscribe: function(el) {
|
||||
$(el).off('.textInputBinding');
|
||||
},
|
||||
receiveMessage: function(el, data) {
|
||||
if (data.hasOwnProperty('value'))
|
||||
this.setValue(el, data.value);
|
||||
var textInputBinding = new InputBinding();
|
||||
$.extend(textInputBinding, {
|
||||
find: function(scope) {
|
||||
return $(scope).find('input[type="text"], input[type="password"], input[type="search"], input[type="url"], input[type="email"]');
|
||||
},
|
||||
getId: function(el) {
|
||||
return InputBinding.prototype.getId.call(this, el) || el.name;
|
||||
},
|
||||
getValue: function(el) {
|
||||
return el.value;
|
||||
},
|
||||
setValue: function(el, value) {
|
||||
el.value = value;
|
||||
},
|
||||
subscribe: function(el, callback) {
|
||||
$(el).on('keyup.textInputBinding input.textInputBinding', function(event) {
|
||||
callback(true);
|
||||
});
|
||||
$(el).on('change.textInputBinding', function(event) {
|
||||
callback(false);
|
||||
});
|
||||
},
|
||||
unsubscribe: function(el) {
|
||||
$(el).off('.textInputBinding');
|
||||
},
|
||||
receiveMessage: function(el, data) {
|
||||
if (data.hasOwnProperty('value'))
|
||||
this.setValue(el, data.value);
|
||||
|
||||
if (data.hasOwnProperty('label'))
|
||||
$(el).parent().find('label[for="' + $escape(el.id) + '"]').text(data.label);
|
||||
if (data.hasOwnProperty('label'))
|
||||
$(el).parent().find('label[for="' + $escape(el.id) + '"]').text(data.label);
|
||||
|
||||
$(el).trigger('change');
|
||||
},
|
||||
getState: function(el) {
|
||||
return {
|
||||
label: $(el).parent().find('label[for="' + $escape(el.id) + '"]').text(),
|
||||
value: el.value
|
||||
};
|
||||
},
|
||||
getRatePolicy: function() {
|
||||
return {
|
||||
policy: 'debounce',
|
||||
delay: 250
|
||||
};
|
||||
}
|
||||
});
|
||||
inputBindings.register(textInputBinding, 'shiny.textInput');
|
||||
$(el).trigger('change');
|
||||
},
|
||||
getState: function(el) {
|
||||
return {
|
||||
label: $(el).parent().find('label[for="' + $escape(el.id) + '"]').text(),
|
||||
value: el.value
|
||||
};
|
||||
},
|
||||
getRatePolicy: function() {
|
||||
return {
|
||||
policy: 'debounce',
|
||||
delay: 250
|
||||
};
|
||||
}
|
||||
});
|
||||
inputBindings.register(textInputBinding, 'shiny.textInput');
|
||||
|
||||
Reference in New Issue
Block a user