Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions core/modules/utils/dom/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,11 @@ Various static DOM-related utility functions.

var Popup = require("$:/core/modules/utils/dom/popup.js");

/*
Determines whether element 'a' contains element 'b'
Code thanks to John Resig, http://ejohn.org/blog/comparing-document-position/
*/
exports.domContains = function(a,b) {
return a.contains ?
a !== b && a.contains(b) :
!!(a.compareDocumentPosition(b) & 16);
};
// Deprecated: Use compareDocumentPosition instead
exports.domContains = (a,b) => a.compareDocumentPosition(b) & 16;

exports.domMatchesSelector = function(node,selector) {
return node.matches ? node.matches(selector) : node.msMatchesSelector(selector);
};
// Deprecated: Use matches instead
exports.domMatchesSelector = (node,selector) => node.matches(selector);

/*
Select text in a an input or textarea (setSelectionRange crashes on certain input types)
Expand Down
5 changes: 2 additions & 3 deletions core/modules/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,8 @@ exports.parseInt = function(str) {
return parseInt(str,10) || 0;
};

exports.stringifyNumber = function(num) {
return num + "";
};
// Use Number.toString instead
exports.stringifyNumber = num => num.toString();

exports.makeCompareFunction = function(type,options) {
options = options || {};
Expand Down