mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
fix: Stop event propagation in widgets
This commit is contained in:
parent
fcc625cb0c
commit
9a2d227318
2 changed files with 9 additions and 14 deletions
|
|
@ -231,12 +231,13 @@ limitations under the License.
|
|||
class="input-group">
|
||||
<input type="text" class="form-control input-sm"
|
||||
style="font-weight: 400; font-size: 12px; vertical-align:middle; border-radius: 5px;"
|
||||
ng-keydown="saveConfigOnEnter($event)"
|
||||
ng-keydown="parameterOnKeyDown($event, paramSpec)"
|
||||
data-ng-model="config.parameter[config.chart.current][paramSpec.name]" />
|
||||
</div>
|
||||
<div class="btn-group"
|
||||
ng-if="isOptionWidget(paramSpec)">
|
||||
<select class="form-control input-sm"
|
||||
ng-keydown="parameterOnKeyDown($event, paramSpec)"
|
||||
ng-change="parameterChanged(paramSpec)"
|
||||
data-ng-model="config.parameter[config.chart.current][paramSpec.name]"
|
||||
data-ng-options="optionValue for optionValue in paramSpec.optionValues"
|
||||
|
|
@ -246,6 +247,7 @@ limitations under the License.
|
|||
|
||||
<div ng-if="isCheckboxWidget(paramSpec)">
|
||||
<input type="checkbox"
|
||||
ng-keydown="parameterOnKeyDown($event, paramSpec)"
|
||||
ng-click="parameterChanged(paramSpec)"
|
||||
data-ng-model="config.parameter[config.chart.current][paramSpec.name]"
|
||||
data-ng-checked="config.parameter[config.chart.current][paramSpec.name]" />
|
||||
|
|
@ -253,7 +255,7 @@ limitations under the License.
|
|||
|
||||
<div ng-if="isTextareaWidget(paramSpec)">
|
||||
<textarea class="form-control" rows="3"
|
||||
ng-keydown="saveConfigOnShiftEnter($event)"
|
||||
ng-keydown="parameterOnKeyDown($event, paramSpec)"
|
||||
data-ng-model="config.parameter[config.chart.current][paramSpec.name]"
|
||||
style="font-weight: 400; font-size: 12px;">
|
||||
</textarea>
|
||||
|
|
|
|||
|
|
@ -137,21 +137,16 @@ class AdvancedTransformation extends Transformation {
|
|||
self.emitConfig(configInstance)
|
||||
},
|
||||
|
||||
saveConfigOnEnter: function(event) {
|
||||
parameterOnKeyDown: function(event, paramSpec) {
|
||||
const code = event.keyCode || event.which;
|
||||
if (code === 13) {
|
||||
if (code === 13 && isInputWidget(paramSpec)) {
|
||||
self.emitConfig(configInstance)
|
||||
}
|
||||
},
|
||||
|
||||
saveConfigOnShiftEnter: function(event) {
|
||||
const code = event.keyCode || event.which;
|
||||
|
||||
if (code === 13 && event.shiftKey) {
|
||||
event.stopPropagation(); /** avoid to run paragraph */
|
||||
} else if (code === 13 && event.shiftKey && isTextareaWidget(paramSpec)) {
|
||||
self.emitConfig(configInstance)
|
||||
}
|
||||
|
||||
event.stopPropagation(); /** avoid to conflict with paragraph shortcuts */
|
||||
},
|
||||
|
||||
}
|
||||
|
|
@ -175,9 +170,7 @@ class AdvancedTransformation extends Transformation {
|
|||
const aggregatorColumns = columns.aggregator;
|
||||
const customColumns = columns.custom
|
||||
|
||||
console.log(parsedParam)
|
||||
|
||||
let transformer = getTransformer(conf, tableData.rows, keyColumns, groupColumns, aggregatorColumns)
|
||||
let transformer = getTransformer(conf, tableData.rows, keyColumns, groupColumns, aggregatorColumns)
|
||||
|
||||
return {
|
||||
chart: chart, /** current chart */
|
||||
|
|
|
|||
Loading…
Reference in a new issue