@radioactive-labs/plutonium 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/dist/js/plutonium.js +35 -0
- package/src/dist/js/plutonium.js.map +3 -3
- package/src/dist/js/plutonium.min.js +24 -24
- package/src/dist/js/plutonium.min.js.map +3 -3
- package/src/js/controllers/flatpickr_controller.js +23 -0
- package/src/js/controllers/sidebar_controller.js +28 -1
package/package.json
CHANGED
package/src/dist/js/plutonium.js
CHANGED
|
@@ -16884,6 +16884,21 @@ ${text2}</tr>
|
|
|
16884
16884
|
}
|
|
16885
16885
|
if (this.modal) {
|
|
16886
16886
|
options2.appendTo = this.modal;
|
|
16887
|
+
options2.position = (instance) => {
|
|
16888
|
+
const input = instance.altInput || instance.input;
|
|
16889
|
+
const inputRect = input.getBoundingClientRect();
|
|
16890
|
+
const modalRect = this.modal.getBoundingClientRect();
|
|
16891
|
+
const cal = instance.calendarContainer;
|
|
16892
|
+
const calHeight = cal.offsetHeight;
|
|
16893
|
+
const spaceBelow = window.innerHeight - inputRect.bottom;
|
|
16894
|
+
const showAbove = spaceBelow < calHeight && inputRect.top > calHeight;
|
|
16895
|
+
const top2 = showAbove ? inputRect.top - modalRect.top - calHeight - 2 : inputRect.bottom - modalRect.top + 2;
|
|
16896
|
+
cal.style.top = `${top2}px`;
|
|
16897
|
+
cal.style.left = `${inputRect.left - modalRect.left}px`;
|
|
16898
|
+
cal.style.right = "auto";
|
|
16899
|
+
cal.classList.toggle("arrowTop", !showAbove);
|
|
16900
|
+
cal.classList.toggle("arrowBottom", showAbove);
|
|
16901
|
+
};
|
|
16887
16902
|
}
|
|
16888
16903
|
return options2;
|
|
16889
16904
|
}
|
|
@@ -27674,7 +27689,27 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
|
27674
27689
|
};
|
|
27675
27690
|
|
|
27676
27691
|
// src/js/controllers/sidebar_controller.js
|
|
27692
|
+
var savedScrollTop = 0;
|
|
27677
27693
|
var sidebar_controller_default = class extends Controller {
|
|
27694
|
+
static targets = ["scroll"];
|
|
27695
|
+
connect() {
|
|
27696
|
+
this.beforeRender = this.beforeRender.bind(this);
|
|
27697
|
+
this.afterRender = this.afterRender.bind(this);
|
|
27698
|
+
document.addEventListener("turbo:before-render", this.beforeRender);
|
|
27699
|
+
document.addEventListener("turbo:render", this.afterRender);
|
|
27700
|
+
}
|
|
27701
|
+
disconnect() {
|
|
27702
|
+
document.removeEventListener("turbo:before-render", this.beforeRender);
|
|
27703
|
+
document.removeEventListener("turbo:render", this.afterRender);
|
|
27704
|
+
}
|
|
27705
|
+
beforeRender() {
|
|
27706
|
+
if (this.hasScrollTarget)
|
|
27707
|
+
savedScrollTop = this.scrollTarget.scrollTop;
|
|
27708
|
+
}
|
|
27709
|
+
afterRender() {
|
|
27710
|
+
if (this.hasScrollTarget)
|
|
27711
|
+
this.scrollTarget.scrollTop = savedScrollTop;
|
|
27712
|
+
}
|
|
27678
27713
|
};
|
|
27679
27714
|
|
|
27680
27715
|
// src/js/controllers/password_visibility_controller.js
|