mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Replace double-click with icon+single click
This commit is contained in:
@@ -3,11 +3,20 @@ div.table-name {
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
padding: 2px 10px;
|
||||
padding: 2px 22px 2px 10px;
|
||||
border-radius: @redash-radius;
|
||||
position: relative;
|
||||
|
||||
.copy-to-editor {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: fade(@redash-gray, 10%);
|
||||
|
||||
.copy-to-editor {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,12 +37,34 @@ div.table-name {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.table-open {
|
||||
padding-left: 26px;
|
||||
.copy-to-editor {
|
||||
color: fade(@redash-gray, 90%);
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.table-open {
|
||||
padding: 0 22px 0 26px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
|
||||
.copy-to-editor {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: fade(@redash-gray, 10%);
|
||||
.copy-to-editor {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,17 +10,20 @@
|
||||
|
||||
<div class="schema-browser" vs-repeat vs-size="$ctrl.getSize(table)">
|
||||
<div ng-repeat="table in $ctrl.schema | filter:$ctrl.schemaFilter track by table.name">
|
||||
<div class="table-name" ng-click="$ctrl.showTable(table)"
|
||||
ng-dblclick="$ctrl.itemSelected([table.name])">
|
||||
<div class="table-name" ng-click="$ctrl.showTable(table)">
|
||||
<i class="fa fa-table"></i>
|
||||
<strong>
|
||||
<span title="{{table.name}}">{{table.name}}</span>
|
||||
<span ng-if="table.size !== undefined"> ({{table.size}})</span>
|
||||
</strong>
|
||||
<i class="fa fa-angle-double-right copy-to-editor" aria-hidden="true"
|
||||
ng-click="$ctrl.itemSelected($event, [table.name])"></i>
|
||||
</div>
|
||||
<div uib-collapse="table.collapsed">
|
||||
<div ng-repeat="column in table.columns track by column" class="table-open"
|
||||
ng-dblclick="$ctrl.itemSelected([table.name, column])">{{column}}</div>
|
||||
<div ng-repeat="column in table.columns track by column" class="table-open">{{column}}
|
||||
<i class="fa fa-angle-double-right copy-to-editor" aria-hidden="true"
|
||||
ng-click="$ctrl.itemSelected($event, [table.name, column])"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -22,9 +22,10 @@ function SchemaBrowserCtrl($rootScope, $scope) {
|
||||
return this.schema === undefined || this.schema.length === 0;
|
||||
};
|
||||
|
||||
this.itemSelected = (hierarchy) => {
|
||||
this.itemSelected = ($event, hierarchy) => {
|
||||
$rootScope.$broadcast('schema-browser-select', hierarchy);
|
||||
window.getSelection().removeAllRanges();
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user