// do not send '_dc' parameter
Ext.Ajax.disableCaching = false;
+// FIXME: HACK! Makes scrolling in number spinner work again. fixed in ExtJS >= 6.1
+if (Ext.isFirefox) {
+ Ext.$eventNameMap.DOMMouseScroll = 'DOMMouseScroll';
+}
+
// custom Vtypes
Ext.apply(Ext.form.field.VTypes, {
IPAddress: function(v) {
BridgeName: function(v) {
return (/^vmbr\d{1,4}$/).test(v);
},
+ VlanName: function(v) {
+ if (Proxmox.Utils.VlanInterface_match.test(v)) {
+ return true;
+ } else if (Proxmox.Utils.Vlan_match.test(v)) {
+ return true;
+ }
+ return true;
+ },
BridgeNameText: gettext('Format') + ': vmbr<b>N</b>, where 0 <= <b>N</b> <= 9999',
BondName: function(v) {
me.clearValue();
me.setValue(me.originalValue);
}
- }
+ },
+
+ // we also want to open the trigger on editable comboboxes by default
+ initComponent: function() {
+ let me = this;
+ me.callParent();
+
+ if (me.editable) {
+ // The trigger.picker causes first a focus event on the field then
+ // toggles the selection picker. Thus skip expanding in this case,
+ // else our focus listener expands and the picker.trigger then
+ // collapses it directly afterwards.
+ Ext.override(me.triggers.picker, {
+ onMouseDown: function(e) {
+ // copied "should we focus" check from Ext.form.trigger.Trigger
+ if (e.pointerType !== 'touch' && !this.field.owns(Ext.Element.getActiveElement())) {
+ me.skip_expand_on_focus = true;
+ }
+ this.callParent(arguments);
+ }
+ });
+
+ me.on("focus", function(combobox) {
+ if (!combobox.isExpanded && !combobox.skip_expand_on_focus) {
+ combobox.expand();
+ }
+ combobox.skip_expand_on_focus = false;
+ });
+ }
+ },
});
// when refreshing a grid/tree view, restoring the focus moves the view back to
});
+// add '@' to the valid id
+Ext.define('Proxmox.validIdReOverride', {
+ override: 'Ext.Component',
+ validIdRe: /^[a-z_][a-z0-9\-_\@]*$/i,
+});
+
// force alert boxes to be rendered with an Error Icon
// since Ext.Msg is an object and not a prototype, we need to override it
// after the framework has been initiated