Browse Source

Merge branch 'dev' into page-manager

pull/3411/head
Artur Arseniev 6 years ago
parent
commit
a23e912360
  1. 10
      .github/ISSUE_TEMPLATE/01_bug_report.md
  2. 8
      .github/ISSUE_TEMPLATE/02_feature_request.md
  3. 2
      src/i18n/locale/de.js
  4. 9
      src/navigator/view/ItemView.js
  5. 2
      src/utils/mixins.js

10
.github/ISSUE_TEMPLATE/01_bug_report.md

@ -19,8 +19,8 @@ READ and FOLLOW next 3 steps, then REMOVE them before posting the issue
**Are you able to reproduce the bug from the demo?**
[ ] Yes
[ ] No
- [ ] Yes
- [ ] No
**What is the expected behavior?**
@ -28,9 +28,9 @@ READ and FOLLOW next 3 steps, then REMOVE them before posting the issue
**What is the current behavior?**
*Descripe the bug **detailed***
*Describe the bug **detailed***
**Are you able to attach screenshots, screencasts or a live demo?**
[ ] Yes (attach)
[ ] No
- [ ] Yes (attach)
- [ ] No

8
.github/ISSUE_TEMPLATE/02_feature_request.md

@ -19,10 +19,10 @@ READ and FOLLOW next 3 steps, then REMOVE them before posting the issue
**Is there an alternative at the latest version?**
[ ] Yes (descripe the alternative)
[ ] No
- [ ] Yes (describe the alternative)
- [ ] No
**Is this related to an issue?**
[ ] Yes (Give a link to the issue)
[ ] No
- [ ] Yes (Give a link to the issue)
- [ ] No

2
src/i18n/locale/de.js

@ -72,7 +72,7 @@ export default {
styleManager: {
empty:
"Wählen Sie ein Element aus bevor Sie den Stil Manager nutzen",
layer: 'Evene',
layer: 'Ebene',
fileButton: 'Bilder',
sectors: {
general: 'Allgemein',

9
src/navigator/view/ItemView.js

@ -1,5 +1,5 @@
import { isUndefined, isString, bindAll } from 'underscore';
import { getModel } from 'utils/mixins';
import { getModel, isEscKey, isEnterKey } from 'utils/mixins';
import Backbone from 'backbone';
import ComponentView from 'dom_components/view/ComponentView';
import { eventDrag } from 'dom_components/model/Component';
@ -18,6 +18,7 @@ export default Backbone.View.extend({
'mouseover [data-toggle-select]': 'handleHover',
'mouseout [data-toggle-select]': 'handleHoverOut',
'dblclick [data-name]': 'handleEdit',
'keydown [data-name]': 'handleEditKey',
'focusout [data-name]': 'handleEditEnd'
},
@ -163,6 +164,7 @@ export default Backbone.View.extend({
const inputEl = this.getInputName();
inputEl[inputProp] = true;
inputEl.focus();
document.execCommand('selectAll', false, null);
em && em.setEditing(1);
$el
.find(`.${this.inputNameCls}`)
@ -170,6 +172,11 @@ export default Backbone.View.extend({
.addClass(clsEdit);
},
handleEditKey(ev) {
ev.stopPropagation();
(isEscKey(ev) || isEnterKey(ev)) && this.handleEditEnd(ev);
},
/**
* Handle with the end of editing of the component name
*/

2
src/utils/mixins.js

@ -210,6 +210,7 @@ const getPointerEvent = ev =>
const getKeyCode = ev => ev.which || ev.keyCode;
const getKeyChar = ev => String.fromCharCode(getKeyCode(ev));
const isEscKey = ev => getKeyCode(ev) === 27;
const isEnterKey = ev => getKeyCode(ev) === 13;
const isObject = val =>
val !== null && !Array.isArray(val) && typeof val === 'object';
const isEmptyObj = val => Object.keys(val).length <= 0;
@ -247,6 +248,7 @@ export {
getKeyCode,
getKeyChar,
isEscKey,
isEnterKey,
getElement,
shallowDiff,
normalizeFloat,

Loading…
Cancel
Save