mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-03 22:07:14 +00:00
Add the querySelectorSafe() function and replace querySelector() usage (#7380)
* Initial commit * Correct the over-estimation of my abilities * Add fallback and move code to dom.js * Use new function for tm-focus-selector * Replace other uses of querySelector* * Undo rash replacements of querySelector()
This commit is contained in:
@@ -119,8 +119,8 @@ ScrollableWidget.prototype.scrollIntoView = function(element,callback,options) {
|
||||
};
|
||||
|
||||
ScrollableWidget.prototype.scrollSelectorIntoView = function(baseElement,selector,callback,options) {
|
||||
baseElement = baseElement || document.body;
|
||||
var element = baseElement.querySelector(selector);
|
||||
baseElement = baseElement || document;
|
||||
var element = $tw.utils.querySelectorSafe(selector,baseElement);
|
||||
if(element) {
|
||||
this.scrollIntoView(element,callback,options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user