File tree Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Expand file tree Collapse file tree 3 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,35 @@ OperationsWaiter.prototype.getSelectedOp = function(ops) {
155
155
*/
156
156
OperationsWaiter . prototype . opListCreate = function ( e ) {
157
157
this . manager . recipe . createSortableSeedList ( e . target ) ;
158
- $ ( "[data-toggle=popover]" ) . popover ( ) ;
158
+ this . enableOpsListPopovers ( e . target ) ;
159
+ } ;
160
+
161
+
162
+ /**
163
+ * Sets up popovers, allowing the popover itself to gain focus which enables scrolling
164
+ * and other interactions.
165
+ *
166
+ * @param {Element } el - The element to start selecting from
167
+ */
168
+ OperationsWaiter . prototype . enableOpsListPopovers = function ( el ) {
169
+ $ ( el ) . find ( "[data-toggle=popover]" ) . addBack ( "[data-toggle=popover]" )
170
+ . popover ( { trigger : "manual" } )
171
+ . on ( "mouseenter" , function ( ) {
172
+ const _this = this ;
173
+ $ ( this ) . popover ( "show" ) ;
174
+ $ ( ".popover" ) . on ( "mouseleave" , function ( ) {
175
+ $ ( _this ) . popover ( "hide" ) ;
176
+ } ) ;
177
+ } ) . on ( "mouseleave" , function ( ) {
178
+ const _this = this ;
179
+ setTimeout ( function ( ) {
180
+ // Determine if the popover associated with this element is being hovered over
181
+ if ( $ ( _this ) . data ( "bs.popover" ) &&
182
+ ! $ ( _this ) . data ( "bs.popover" ) . $tip . is ( ":hover" ) ) {
183
+ $ ( _this ) . popover ( "hide" ) ;
184
+ }
185
+ } , 50 ) ;
186
+ } ) ;
159
187
} ;
160
188
161
189
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ RecipeWaiter.prototype.createSortableSeedList = function(listEl) {
93
93
// Removes popover element and event bindings from the dragged operation but not the
94
94
// event bindings from the one left in the operations list. Without manually removing
95
95
// these bindings, we cannot re-initialise the popover on the stub operation.
96
- $ ( evt . item ) . popover ( "destroy" ) ;
96
+ $ ( evt . item ) . popover ( "destroy" ) . removeData ( "bs.popover" ) . off ( "mouseenter" ) . off ( "mouseleave" ) ;
97
97
$ ( evt . clone ) . off ( ".popover" ) . removeData ( "bs.popover" ) ;
98
98
evt . item . setAttribute ( "data-toggle" , "popover-disabled" ) ;
99
99
} ,
@@ -120,8 +120,7 @@ RecipeWaiter.prototype.opSortEnd = function(evt) {
120
120
121
121
// Reinitialise the popover on the original element in the ops list because for some reason it
122
122
// gets destroyed and recreated.
123
- $ ( evt . clone ) . popover ( ) ;
124
- $ ( evt . clone ) . children ( "[data-toggle=popover]" ) . popover ( ) ;
123
+ this . manager . ops . enableOpsListPopovers ( evt . clone ) ;
125
124
126
125
if ( evt . item . parentNode . id !== "rec-list" ) {
127
126
return ;
Original file line number Diff line number Diff line change @@ -142,6 +142,10 @@ optgroup {
142
142
border-color : var (--popover-border-colour );
143
143
}
144
144
145
+ .popover-content {
146
+ max-height : 90vh ;
147
+ overflow-y : auto;
148
+ }
145
149
146
150
.popover .right > .arrow {
147
151
border-right-color : var (--popover-border-colour );
You can’t perform that action at this time.
0 commit comments