mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
parent fc713a3cd5
author Dannon Baker <dannon.baker@gmail.com> 1580426715 -0500 committer Dannon Baker <dannon.baker@gmail.com> 1581649360 -0500 Drop bower exclusion from babel-loader. We need to transpile bootstrap-vue, otherwise edge blows up. Edge can't handle two events on the same element (?!?!?!) and silently just doesn't fire change when there's also an input binding here? Update commentary for babel stage excludes Add IMask functionality for initial input masking (similar to previous functionality, but a little more robust). We may want to work on the regex here. Fix unused var/eslint Adjust karma's webpack config to completely ignore node-modules for transpilation, fixes it messing with bootstrap-vue and failing Client format...
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Backbone from "backbone";
|
||||
import IMask from "imask";
|
||||
|
||||
import Utils from "utils/utils";
|
||||
|
||||
@@ -23,20 +24,23 @@ const View = Backbone.View.extend({
|
||||
this.$text = this.$(".ui-form-slider-text");
|
||||
this.$slider = this.$(".ui-form-slider-element");
|
||||
|
||||
// add text field event
|
||||
this.$text
|
||||
.on("change", e => {
|
||||
this.value(e.currentTarget.value);
|
||||
})
|
||||
.on("input", e => {
|
||||
const input = e.currentTarget;
|
||||
if (this._isParameter(input.value)) {
|
||||
return;
|
||||
} else if (!this.model.get("precise")) {
|
||||
input.value = input.value.split(".")[0];
|
||||
IMask(this.$text[0], {
|
||||
mask: value => {
|
||||
if (this._isParameter(value)) {
|
||||
return true;
|
||||
}
|
||||
input.value = input.value.replace(/[^0-9eE.-]/g, "");
|
||||
});
|
||||
if (!this.model.get("precise")) {
|
||||
if (value != value.split(".")[0]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return value == value.replace(/[^0-9eE.-]/g, "");
|
||||
}
|
||||
});
|
||||
|
||||
this.$text[0].addEventListener("change", e => {
|
||||
this.value(e.currentTarget.value);
|
||||
});
|
||||
|
||||
// build slider, cannot be rebuild in render
|
||||
const opts = this.model.attributes;
|
||||
|
||||
@@ -36,9 +36,14 @@ module.exports = (env, argv) => {
|
||||
// Using babel-plugin-rewire to handle dependency mocking since webpack 4
|
||||
// exports immutable bindings for ES modules but we still need a way to
|
||||
// overwrite dependencies during unit-testing.
|
||||
//
|
||||
// Additionally, set exclude for babel-loader to completely ignore *all*
|
||||
// node-modules, without our exceptions to support IE as in parent webpack
|
||||
// config.
|
||||
|
||||
wpConfig.module.rules = wpConfig.module.rules.map(rule => {
|
||||
if (rule.loader == "babel-loader") {
|
||||
rule.exclude = [/(node_modules\/)/]
|
||||
rule.options.plugins.push("rewire");
|
||||
}
|
||||
return rule;
|
||||
|
||||
@@ -66,11 +66,12 @@ module.exports = (env = {}, argv = {}) => {
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
// Pretty sure we don't want anything except node_modules here
|
||||
exclude: [
|
||||
/(node_modules\/(?!(handsontable)\/)|bower_components)/,
|
||||
libsBase
|
||||
],
|
||||
/*
|
||||
* Babel transpile excludes for:
|
||||
* - all node_modules except for handsontable, bootstrap-vue
|
||||
* - statically included libs (like old jquery plugins, etc.)
|
||||
*/
|
||||
exclude: [/(node_modules\/(?!(handsontable|bootstrap-vue)\/))/, libsBase],
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
cacheDirectory: true,
|
||||
|
||||
Reference in New Issue
Block a user