updates
This commit is contained in:
+1
-1
@@ -529,7 +529,7 @@ export class App extends Boot {
|
||||
/**
|
||||
* Left Logo - Ev Handler
|
||||
*/
|
||||
$('.left-logo').dxOn('click', (_, t) => {
|
||||
$('.left-logo')?.dxOn('click', (_, t) => {
|
||||
if (App.section != App.config.home) {
|
||||
App.initModule(App.config.home, {}, { eTarget: t });
|
||||
}
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ import { DatePicker } from '../widgets/date-picker/DatePicker';
|
||||
import { TwoDatePicker } from '../widgets/two-datepicker/TwoDatepicker';
|
||||
import { IntervalPicker } from '../widgets/interval-picker/IntervalPicker';
|
||||
import { Uploader } from '../widgets/uploader/Uploader';
|
||||
import { PinBox } from '../widgets/pin-box/PinBox';
|
||||
|
||||
export class Render {
|
||||
|
||||
@@ -979,7 +980,7 @@ export class Render {
|
||||
|
||||
Render.makeFieldWrapper(field, parent).append(input);
|
||||
|
||||
input.PinBox({ digits: field.digits || 6 });
|
||||
new PinBox(input, { digits: field.digits || 6 });
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import './popover.css';
|
||||
import { Ut } from '../../utils/Ut';
|
||||
import { El, $ } from "../../utils/dom";
|
||||
import { Overlay } from '../overlay';
|
||||
import { Boot } from '../../core/Boot';
|
||||
|
||||
export class Popover {
|
||||
|
||||
@@ -30,7 +31,7 @@ export class Popover {
|
||||
|
||||
if (!this.opts.multiple) {
|
||||
// Destroy old instances
|
||||
Boot.widgetStack?.Popover.forEach(popover => popover.destroy());
|
||||
Boot.widgetStack?.Popover?.forEach(popover => popover.destroy());
|
||||
}
|
||||
|
||||
this.create();
|
||||
|
||||
@@ -68,13 +68,7 @@ export class Uploader {
|
||||
*/
|
||||
setRouter() {
|
||||
|
||||
let router = Boot.intData?.config?.media;
|
||||
|
||||
if (!router) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.router = router[ this.target.name ];
|
||||
this.router = pubData?.media?.[this.target.name];
|
||||
|
||||
if (!this.router) {
|
||||
return false;
|
||||
@@ -91,7 +85,7 @@ export class Uploader {
|
||||
}
|
||||
|
||||
if (this.router.img) {
|
||||
ext.push('jpg', 'jpeg', 'png', 'webp');
|
||||
ext.push('jpg', 'jpeg', 'png', 'webp', 'svg');
|
||||
}
|
||||
|
||||
this.router.ext = [ ... new Set(ext) ].join('|');
|
||||
@@ -462,7 +456,10 @@ export class Uploader {
|
||||
|
||||
thumb.dataset.id = src;
|
||||
|
||||
thumb.href = that.dir + '/' + src.replace('0_', '1_') + '?' + _now;
|
||||
const ext = that.getFileExt(src);
|
||||
|
||||
thumb.href = that.dir + '/' + (ext != 'svg' ? src.replace('0_', '1_') : src) + '?' + _now;
|
||||
|
||||
}
|
||||
else { // Multiple Files > Another File Extension
|
||||
|
||||
@@ -495,12 +492,14 @@ export class Uploader {
|
||||
|
||||
// Single File
|
||||
|
||||
let ext = that.getFileExt(files[0]);
|
||||
let _now = Date.now();
|
||||
const ext = that.getFileExt(files[0]);
|
||||
const _now = Date.now();
|
||||
let filename = files[0];
|
||||
|
||||
if (that.isImageFile(files[0])) { // Single File > Image Extension
|
||||
|
||||
|
||||
|
||||
if (!thumbs.length) {
|
||||
|
||||
let thumb = El('a', { className: 'loading' },
|
||||
@@ -509,7 +508,7 @@ export class Uploader {
|
||||
);
|
||||
|
||||
thumb.dataset.id = filename;
|
||||
thumb.href = this.dir + '/' + filename.replace('0_', '1_') + '?' + _now;
|
||||
thumb.href = this.dir + '/' + (ext != 'svg' ? filename.replace('0_', '1_') : filename) + '?' + _now;
|
||||
|
||||
this.ui.prepend(thumb);
|
||||
}
|
||||
@@ -522,10 +521,9 @@ export class Uploader {
|
||||
img.classList.remove('icon');
|
||||
|
||||
thumb.dataset.id = filename;
|
||||
thumb.href = this.dir + '/' + (ext != 'svg' ? filename.replace('0_', '1_') : filename) + '?' + _now;
|
||||
|
||||
thumb.removeAttribute('target');
|
||||
|
||||
thumb.href = this.dir + '/' + filename.replace('0_', '1_') + '?' + _now;
|
||||
}
|
||||
}
|
||||
else { // Single File > Another File Extension
|
||||
@@ -608,8 +606,7 @@ export class Uploader {
|
||||
* Uploader , Check for imgs ext
|
||||
*/
|
||||
isImageFile(filename) {
|
||||
let ext = this.getFileExt(filename);
|
||||
return (ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'webp')
|
||||
return ['jpg', 'jpeg', 'png', 'webp', 'svg'].includes( this.getFileExt(filename) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -662,7 +659,7 @@ export class Uploader {
|
||||
*/
|
||||
getFileExt(file) {
|
||||
let token = file.split('?')[0].split('.', 2);
|
||||
return token.length == 2 ? token[1] : '';
|
||||
return token.length === 2 ? token[1] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user