180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
D.addClass(this.e, 'hidden');
this.e.style.removeProperty('left');
this.e.style.removeProperty('top');
}
return this;
},
hide: function(){return this.show(false)}
}/*F.PopupWidget.prototype*/;
/**
Internal impl for F.toast() and friends.
args:
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
D.addClass(this.e, 'hidden');
this.e.style.removeProperty('left');
this.e.style.removeProperty('top');
}
return this;
},
hide: function(){return this.show(false)},
/**
A convenience method which adds click handlers to this popup's
main element and document.body to hide the popup when either
element is clicked or the ESC key is pressed. Only call this
once per instance, if at all. Returns this;
*/
installClickToHide: function f(){
this.e.addEventListener('click', ()=>this.show(false), false);
document.body.addEventListener('click', ()=>this.show(false), true);
const self = this;
document.body.addEventListener('keydown', function(ev){
if(self.isShown() && 27===ev.which) self.show(false);
}, true);
return this;
}
}/*F.PopupWidget.prototype*/;
/**
Internal impl for F.toast() and friends.
args:
|
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
if(!fch.popup){
fch.popup = new F.PopupWidget({
cssClass: ['fossil-tooltip', 'help-buttonlet-content'],
refresh: function(){
}
});
fch.popup.e.style.maxWidth = '80%'/*of body*/;
const hide = ()=>fch.popup.hide();
fch.popup.e.addEventListener('click', hide, false);
document.body.addEventListener('click', hide, true);
document.body.addEventListener('keydown', function(ev){
if(fch.popup.isShown() && 27===ev.which){
fch.popup.hide();
}
}, true);
}
D.append(D.clearElement(fch.popup.e), ev.target.$helpContent);
var popupRect = ev.target.getClientRects()[0];
var x = popupRect.left, y = popupRect.top;
if(x<0) x = 0;
if(y<0) y = 0;
/* Shift the help around a bit to "better" fit the
|
<
<
<
<
<
|
<
<
|
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
|
if(!fch.popup){
fch.popup = new F.PopupWidget({
cssClass: ['fossil-tooltip', 'help-buttonlet-content'],
refresh: function(){
}
});
fch.popup.e.style.maxWidth = '80%'/*of body*/;
fch.popup.installClickToHide();
}
D.append(D.clearElement(fch.popup.e), ev.target.$helpContent);
var popupRect = ev.target.getClientRects()[0];
var x = popupRect.left, y = popupRect.top;
if(x<0) x = 0;
if(y<0) y = 0;
/* Shift the help around a bit to "better" fit the
|