Skip to content

Commit 341b798

Browse files
authored
gui: Fix tooltips on buttons inside button groups (ref syncthing#7984) (syncthing#9008)
As per Bootstrap recommendation, buttons with tooltips inside button groups require to have container: 'body' set. This prevents tooltips from causing the buttons to jump on hover and also allows the tooltips to be wider instead of wrapping on every space. Ref: https://getbootstrap.com/docs/3.3/components/#btn-groups Signed-off-by: Tomasz Wilczyński <[email protected]>
1 parent 3199161 commit 341b798

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

gui/default/assets/css/overrides.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -574,13 +574,6 @@ html[lang|="ko"] i {
574574
font-style: normal;
575575
}
576576

577-
/* Prevent buttons from jumping up and down
578-
when a tooltip is shown for one of them. */
579-
.btn-group-vertical > .tooltip + .btn,
580-
.btn-group-vertical > .tooltip + .btn-group {
581-
margin-top: -1px;
582-
}
583-
584577
.select-on-click {
585578
-webkit-user-select: all;
586579
user-select: all;

gui/default/syncthing/device/editDeviceModalView.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
<input ng-if="editingDeviceNew()" name="deviceID" id="deviceID" class="form-control text-monospace" type="text" ng-model="currentDevice.deviceID" required="" valid-deviceid list="discovery-list" aria-required="true" />
1515
<div ng-if="!editingDeviceNew()" class="well well-sm form-control text-monospace" style="height: auto;" select-on-click>{{currentDevice.deviceID}}</div>
1616
<div id="shareDeviceIdButtons" class="input-group-btn">
17-
<button type="button" class="btn btn-default" ng-click="copyToClipboard($event, currentDevice.deviceID)" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Copy' | translate }}">
17+
<button data-container="body" type="button" class="btn btn-default" ng-click="copyToClipboard($event, currentDevice.deviceID)" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Copy' | translate }}">
1818
<span class="fa fa-lg fa-clone"></span>
1919
</button>
20-
<button type="button" class="btn btn-default" ng-click="shareDeviceIdDialog('email')" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Share by Email' | translate }}">
20+
<button data-container="body" type="button" class="btn btn-default" ng-click="shareDeviceIdDialog('email')" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Share by Email' | translate }}">
2121
<span class="fa fa-lg fa-envelope-o"></span>
2222
</button>
23-
<button type="button" class="btn btn-default" ng-click="shareDeviceIdDialog('sms')" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Share by SMS' | translate }}">
23+
<button data-container="body" type="button" class="btn btn-default" ng-click="shareDeviceIdDialog('sms')" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Share by SMS' | translate }}">
2424
<span class="fa fa-lg fa-comments-o"></span>
2525
</button>
26-
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#idqr" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Show QR' | translate }}">
26+
<button data-container="body" type="button" class="btn btn-default" data-toggle="modal" data-target="#idqr" ng-disabled="editingDeviceNew() && !deviceEditor.deviceID.$valid" tooltip data-original-title="{{ 'Show QR' | translate }}">
2727
<span class="fa fa-lg fa-qrcode"></span>
2828
</button>
2929
</div>

0 commit comments

Comments
 (0)