Bladeren bron

style: ESLint

version-14
Faris Ansari 6 jaren geleden
bovenliggende
commit
a4bc19a2a1
3 gewijzigde bestanden met toevoegingen van 18 en 23 verwijderingen
  1. +0
    -4
      .eslintrc
  2. +13
    -14
      frappe/website/js/bootstrap-4.js
  3. +5
    -5
      generate_bootstrap_theme.js

+ 0
- 4
.eslintrc Bestand weergeven

@@ -19,10 +19,6 @@
"error",
"1tbs"
],
"space-before-function-paren": [
"error",
"never"
],
"space-unary-ops": [
"error",
{ "words": true }


+ 13
- 14
frappe/website/js/bootstrap-4.js Bestand weergeven

@@ -2,21 +2,20 @@ import 'bootstrap/dist/js/bootstrap.bundle';

// multilevel dropdown
$('.dropdown-menu a.dropdown-toggle').on('click', function (e) {
e.preventDefault();
e.stopImmediatePropagation();
if (!$(this).next().hasClass('show')) {
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
}
var $subMenu = $(this).next(".dropdown-menu");
$subMenu.toggleClass('show');

e.preventDefault();
e.stopImmediatePropagation();
if (!$(this).next().hasClass('show')) {
$(this).parents('.dropdown-menu').first().find('.show').removeClass("show");
}
var $subMenu = $(this).next(".dropdown-menu");
$subMenu.toggleClass('show');

$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) {
$('.dropdown-submenu .show').removeClass("show");
});

$(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function () {
$('.dropdown-submenu .show').removeClass("show");
});

return false;
return false;
});

frappe.get_modal = function(title, content) {
@@ -44,7 +43,7 @@ frappe.get_modal = function(title, content) {

frappe.ui.Dialog = class Dialog extends frappe.ui.Dialog {
get_primary_btn() {
return this.$wrapper.find(".modal-footer .btn-primary")
return this.$wrapper.find(".modal-footer .btn-primary");
}

set_primary_action(label, click) {
@@ -59,4 +58,4 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.Dialog {
this.$wrapper.find('.section-body').addClass('w-100');
}
}
}
};

+ 5
- 5
generate_bootstrap_theme.js Bestand weergeven

@@ -17,27 +17,27 @@ sass.render({
node_modules_path,
scss_path
],
importer: function(url, prev, done) {
importer: function(url) {
if (url.startsWith('~')) {
// strip ~ so that it can resolve from node_modules
return {
file: url.slice(1)
}
};
}
// normal file, let it go
return {
file: url
}
};
}
}, function(err, result) {
if (err) {
console.error(err.formatted)
console.error(err.formatted); // eslint-disable-line
return;
}

fs.writeFile(path.resolve(website_theme_path, custom_theme_name), result.css, function(err) {
if (!err) {
console.log(custom_theme_name)
console.log(custom_theme_name); // eslint-disable-line
}
});
});

Laden…
Annuleren
Opslaan