(id, value, type, noCrosstalk, opts)
| 831 | instance.clearInputs = {}; |
| 832 | |
| 833 | var changeInput = function(id, value, type, noCrosstalk, opts) { |
| 834 | var event = id; |
| 835 | id = el.id + '_' + id; |
| 836 | if (type) id = id + ':' + type; |
| 837 | // do not update if the new value is the same as old value |
| 838 | if (event !== 'cell_edit' && !/_clicked$/.test(event) && shinyData.hasOwnProperty(id) && shinyData[id] === JSON.stringify(value)) |
| 839 | return; |
| 840 | shinyData[id] = JSON.stringify(value); |
| 841 | if (HTMLWidgets.shinyMode && Shiny.setInputValue) { |
| 842 | Shiny.setInputValue(id, value, opts); |
| 843 | if (!instance.clearInputs[id]) instance.clearInputs[id] = function() { |
| 844 | Shiny.setInputValue(id, null); |
| 845 | } |
| 846 | } |
| 847 | |
| 848 | // HACK |
| 849 | if (event === "rows_selected" && !noCrosstalk) { |
| 850 | if (crosstalkOptions.group) { |
| 851 | var keys = crosstalkOptions.key; |
| 852 | var selectedKeys = null; |
| 853 | if (value) { |
| 854 | selectedKeys = []; |
| 855 | for (var i = 0; i < value.length; i++) { |
| 856 | // The value array's contents use 1-based row numbers, so we must |
| 857 | // convert to 0-based before indexing into the keys array. |
| 858 | selectedKeys.push(keys[value[i] - 1]); |
| 859 | } |
| 860 | } |
| 861 | instance.ctselectHandle.set(selectedKeys); |
| 862 | } |
| 863 | } |
| 864 | }; |
| 865 | |
| 866 | var addOne = function(x) { |
| 867 | return x.map(function(i) { return 1 + i; }); |
no outgoing calls
no test coverage detected