forked from extern/egroupware
replace jQuery.ui.keyCode.X with EGW_KEY_X
This commit is contained in:
parent
813cd6924e
commit
e4c2432f4c
@ -23,6 +23,7 @@ import {et2_IResizeable} from "./et2_core_interfaces";
|
|||||||
import {et2_evalBool, et2_no_init} from "./et2_core_common";
|
import {et2_evalBool, et2_no_init} from "./et2_core_common";
|
||||||
import {et2_url} from "./et2_widget_url";
|
import {et2_url} from "./et2_widget_url";
|
||||||
import {egw} from "../jsapi/egw_global";
|
import {egw} from "../jsapi/egw_global";
|
||||||
|
import {EGW_KEY_ARROW_DOWN, EGW_KEY_ENTER} from "../egw_action/egw_action_constants";
|
||||||
/**
|
/**
|
||||||
* Tag list widget
|
* Tag list widget
|
||||||
*
|
*
|
||||||
@ -528,13 +529,13 @@ export class et2_taglist extends et2_selectbox implements et2_IResizeable
|
|||||||
*/
|
*/
|
||||||
private _keyup(e, taglist, event)
|
private _keyup(e, taglist, event)
|
||||||
{
|
{
|
||||||
if(event.which === jQuery.ui.keyCode.ENTER
|
if(event.which === EGW_KEY_ENTER
|
||||||
&& taglist.combobox.find('.ms-res-item.ms-res-item-active').length==0
|
&& taglist.combobox.find('.ms-res-item.ms-res-item-active').length==0
|
||||||
&& this.getType() !== 'taglist-email')
|
&& this.getType() !== 'taglist-email')
|
||||||
{
|
{
|
||||||
// Change keycode to abort the validation process
|
// Change keycode to abort the validation process
|
||||||
// This means enter does not add a tag
|
// This means enter does not add a tag
|
||||||
event.keyCode = jQuery.ui.keyCode.DOWN;
|
event.keyCode = EGW_KEY_ARROW_DOWN;
|
||||||
|
|
||||||
this._query_server = true;
|
this._query_server = true;
|
||||||
this.taglist.collapse();
|
this.taglist.collapse();
|
||||||
@ -1545,4 +1546,4 @@ et2_register_widget(et2_taglist_ro, ["taglist_ro","taglist_email_ro", "taglist_a
|
|||||||
|
|
||||||
// Require css
|
// Require css
|
||||||
// included via etemplate2.css
|
// included via etemplate2.css
|
||||||
//if(typeof egw == 'function') egw(window).includeCSS(egw.webserverUrl + "/api/js/jquery/magicsuggest/magicsuggest.css");
|
//if(typeof egw == 'function') egw(window).includeCSS(egw.webserverUrl + "/api/js/jquery/magicsuggest/magicsuggest.css");
|
@ -19,6 +19,7 @@ import {et2_createWidget} from "../etemplate/et2_core_widget";
|
|||||||
import {Et2Dialog} from "../etemplate/Et2Dialog/Et2Dialog";
|
import {Et2Dialog} from "../etemplate/Et2Dialog/Et2Dialog";
|
||||||
import {et2_nextmatch} from "../etemplate/et2_extension_nextmatch";
|
import {et2_nextmatch} from "../etemplate/et2_extension_nextmatch";
|
||||||
import {et2_favorites} from "../etemplate/et2_widget_favorites";
|
import {et2_favorites} from "../etemplate/et2_widget_favorites";
|
||||||
|
import {EGW_KEY_ENTER} from "../egw_action/egw_action_constants";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common base class for application javascript
|
* Common base class for application javascript
|
||||||
@ -897,17 +898,17 @@ export const AppJS = (function(){ "use strict"; return Class.extend(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Bind handler for enter keypress
|
// Bind handler for enter keypress
|
||||||
this.favorite_popup.off('keydown').on('keydown', jQuery.proxy(function(e) {
|
this.favorite_popup.off('keydown').on('keydown', function(e) {
|
||||||
var tagName = e.target.tagName.toLowerCase();
|
var tagName = e.target.tagName.toLowerCase();
|
||||||
tagName = (tagName === 'input' && e.target.type === 'button') ? 'button' : tagName;
|
tagName = (tagName === 'input' && e.target.type === 'button') ? 'button' : tagName;
|
||||||
|
|
||||||
if(e.keyCode == jQuery.ui.keyCode.ENTER && tagName !== 'textarea' && tagName !== 'select' && tagName !=='button')
|
if(e.keyCode == EGW_KEY_ENTER && tagName !== 'textarea' && tagName !== 'select' && tagName !=='button')
|
||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
jQuery('button[default]',this.favorite_popup.parent()).trigger('click');
|
jQuery('button[default]',this.favorite_popup.parent()).trigger('click');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},this));
|
}.bind(this));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
@ -2063,4 +2064,4 @@ export const AppJS = (function(){ "use strict"; return Class.extend(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});}).call(window);
|
});}).call(window);
|
@ -20,6 +20,7 @@ import Sortable from 'sortablejs/modular/sortable.complete.esm.js';
|
|||||||
import {et2_valueWidget} from "../etemplate/et2_core_valueWidget";
|
import {et2_valueWidget} from "../etemplate/et2_core_valueWidget";
|
||||||
import {nm_action} from "../etemplate/et2_extension_nextmatch_actions";
|
import {nm_action} from "../etemplate/et2_extension_nextmatch_actions";
|
||||||
import {Et2Dialog} from "../etemplate/Et2Dialog/Et2Dialog";
|
import {Et2Dialog} from "../etemplate/Et2Dialog/Et2Dialog";
|
||||||
|
import {EGW_KEY_ENTER} from "../egw_action/egw_action_constants";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type for push-message
|
* Type for push-message
|
||||||
@ -1132,18 +1133,18 @@ export abstract class EgwApp
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Bind handler for enter keypress
|
// Bind handler for enter keypress
|
||||||
this.favorite_popup.off('keydown').on('keydown', jQuery.proxy(function(e)
|
this.favorite_popup.off('keydown').on('keydown', function(e)
|
||||||
{
|
{
|
||||||
var tagName = e.target.tagName.toLowerCase();
|
var tagName = e.target.tagName.toLowerCase();
|
||||||
tagName = (tagName === 'input' && e.target.type === 'button') ? 'button' : tagName;
|
tagName = (tagName === 'input' && e.target.type === 'button') ? 'button' : tagName;
|
||||||
|
|
||||||
if(e.keyCode == jQuery.ui.keyCode.ENTER && tagName !== 'textarea' && tagName !== 'select' && tagName !== 'button')
|
if(e.keyCode == EGW_KEY_ENTER && tagName !== 'textarea' && tagName !== 'select' && tagName !== 'button')
|
||||||
{
|
{
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
jQuery('button[default]', this.favorite_popup.parent()).trigger('click');
|
jQuery('button[default]', this.favorite_popup.parent()).trigger('click');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, this));
|
}.bind(this));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ import {et2_grid} from "../../api/js/etemplate/et2_widget_grid";
|
|||||||
import {Et2Textbox} from "../../api/js/etemplate/Et2Textbox/Et2Textbox";
|
import {Et2Textbox} from "../../api/js/etemplate/Et2Textbox/Et2Textbox";
|
||||||
import "./SidemenuDate";
|
import "./SidemenuDate";
|
||||||
import {parseDate} from "../../api/js/etemplate/Et2Date/Et2Date";
|
import {parseDate} from "../../api/js/etemplate/Et2Date/Et2Date";
|
||||||
|
import {EGW_KEY_PAGE_UP,EGW_KEY_PAGE_DOWN} from "../../api/js/egw_action/egw_action_constants";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UI for calendar
|
* UI for calendar
|
||||||
@ -223,8 +224,8 @@ export class CalendarApp extends EgwApp
|
|||||||
}
|
}
|
||||||
this.sidebox_hooked_templates = [];
|
this.sidebox_hooked_templates = [];
|
||||||
|
|
||||||
egw_unregisterGlobalShortcut(jQuery.ui.keyCode.PAGE_UP, false, false, false);
|
egw_unregisterGlobalShortcut(EGW_KEY_PAGE_UP, false, false, false);
|
||||||
egw_unregisterGlobalShortcut(jQuery.ui.keyCode.PAGE_DOWN, false, false, false);
|
egw_unregisterGlobalShortcut(EGW_KEY_PAGE_DOWN, false, false, false);
|
||||||
|
|
||||||
// Stop autorefresh
|
// Stop autorefresh
|
||||||
if(this._autorefresh_timer)
|
if(this._autorefresh_timer)
|
||||||
@ -1354,7 +1355,7 @@ export class CalendarApp extends EgwApp
|
|||||||
scroll_animate.call(this,"up", -1);
|
scroll_animate.call(this,"up", -1);
|
||||||
return true;
|
return true;
|
||||||
}, this);
|
}, this);
|
||||||
egw_registerGlobalShortcut(jQuery.ui.keyCode.PAGE_DOWN, false, false, false, function() {
|
egw_registerGlobalShortcut(EGW_KEY_PAGE_DOWN, false, false, false, function() {
|
||||||
if(app.calendar.state.view == 'listview')
|
if(app.calendar.state.view == 'listview')
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user