mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-14 18:46:19 +02:00
use const and fix up arrow login in saved pane
This commit is contained in:
@ -606,10 +606,10 @@ runBtn, searchInput
|
|||||||
d.resolve(result);
|
d.resolve(result);
|
||||||
});
|
});
|
||||||
} else if (cssMode === CssModes.ACSS) {
|
} else if (cssMode === CssModes.ACSS) {
|
||||||
var html = scope.cm.html.getValue();
|
const html = scope.cm.html.getValue();
|
||||||
var foundClasses = atomizer.findClassNames(html);
|
const foundClasses = atomizer.findClassNames(html);
|
||||||
var finalConfig = atomizer.getConfig(foundClasses, {});
|
const finalConfig = atomizer.getConfig(foundClasses, {});
|
||||||
var acss = atomizer.getCss(finalConfig);
|
const acss = atomizer.getCss(finalConfig);
|
||||||
scope.cm.css.setValue(acss);
|
scope.cm.css.setValue(acss);
|
||||||
d.resolve(acss)
|
d.resolve(acss)
|
||||||
}
|
}
|
||||||
@ -1289,8 +1289,7 @@ runBtn, searchInput
|
|||||||
function compileNodes() {
|
function compileNodes() {
|
||||||
|
|
||||||
function attachListenerForEvent(eventName) {
|
function attachListenerForEvent(eventName) {
|
||||||
var nodes;
|
const nodes = $all(`[d-${eventName}]`);
|
||||||
nodes = $all(`[d-${eventName}]`);
|
|
||||||
nodes.forEach(function (el) {
|
nodes.forEach(function (el) {
|
||||||
el.addEventListener(eventName, function (e) {
|
el.addEventListener(eventName, function (e) {
|
||||||
scope[el.getAttribute(`d-${eventName}`)].call(window, e)
|
scope[el.getAttribute(`d-${eventName}`)].call(window, e)
|
||||||
@ -1482,7 +1481,7 @@ runBtn, searchInput
|
|||||||
selectedItemElement = $('.js-saved-item-tile.selected');
|
selectedItemElement = $('.js-saved-item-tile.selected');
|
||||||
if (selectedItemElement) {
|
if (selectedItemElement) {
|
||||||
selectedItemElement.classList.remove('selected');
|
selectedItemElement.classList.remove('selected');
|
||||||
selectedItemElement.previousElementSibling.classList.add('selected');
|
selectedItemElement.previousUntil('.js-saved-item-tile:not(.hide)').classList.add('selected');
|
||||||
} else {
|
} else {
|
||||||
$('.js-saved-item-tile:not(.hide)').classList.add('selected');
|
$('.js-saved-item-tile:not(.hide)').classList.add('selected');
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
* @return element Next element that mathes `selector`
|
* @return element Next element that mathes `selector`
|
||||||
*/
|
*/
|
||||||
Node.prototype.nextUntil = function (selector) {
|
Node.prototype.nextUntil = function (selector) {
|
||||||
var siblings = [...this.parentNode.querySelectorAll(selector)];
|
const siblings = [...this.parentNode.querySelectorAll(selector)];
|
||||||
var index = siblings.indexOf(this);
|
const index = siblings.indexOf(this);
|
||||||
return siblings[index + 1];
|
return siblings[index + 1];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -24,8 +24,8 @@
|
|||||||
* @return element Next element that mathes `selector`
|
* @return element Next element that mathes `selector`
|
||||||
*/
|
*/
|
||||||
Node.prototype.previousUntil = function (selector) {
|
Node.prototype.previousUntil = function (selector) {
|
||||||
var siblings = [...this.parentNode.querySelectorAll(selector)];
|
const siblings = [...this.parentNode.querySelectorAll(selector)];
|
||||||
var index = siblings.indexOf(this);
|
const index = siblings.indexOf(this);
|
||||||
return siblings[index - 1];
|
return siblings[index - 1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user