Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
1e73c03b
Commit
1e73c03b
authored
Jul 06, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE] Debug focus in menus
parent
f415118e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
50 deletions
+42
-50
apps/common/main/lib/extend/Bootstrap.js
apps/common/main/lib/extend/Bootstrap.js
+5
-4
apps/spreadsheeteditor/main/app/controller/CellEditor.js
apps/spreadsheeteditor/main/app/controller/CellEditor.js
+3
-3
apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+29
-29
apps/spreadsheeteditor/main/app/controller/Main.js
apps/spreadsheeteditor/main/app/controller/Main.js
+5
-14
No files found.
apps/common/main/lib/extend/Bootstrap.js
View file @
1e73c03b
...
@@ -46,8 +46,9 @@ function onDropDownKeyDown(e) {
...
@@ -46,8 +46,9 @@ function onDropDownKeyDown(e) {
$parent
.
trigger
(
beforeEvent
);
$parent
.
trigger
(
beforeEvent
);
if
(
$parent
.
hasClass
(
'
no-stop-propagate
'
)
&&
arguments
.
length
>
1
&&
arguments
[
1
]
instanceof
jQuery
.
Event
)
{
if
(
$parent
.
hasClass
(
'
no-stop-propagate
'
))
{
e
=
arguments
[
1
];
if
(
arguments
.
length
>
1
&&
arguments
[
1
]
instanceof
jQuery
.
Event
)
e
=
arguments
[
1
];
if
(
/^
(
38|40|27|13|9
)
$/
.
test
(
e
.
keyCode
)
&&
!
e
.
ctrlKey
&&
!
e
.
altKey
)
{
if
(
/^
(
38|40|27|13|9
)
$/
.
test
(
e
.
keyCode
)
&&
!
e
.
ctrlKey
&&
!
e
.
altKey
)
{
patchDropDownKeyDownAdditional
.
call
(
this
,
e
);
patchDropDownKeyDownAdditional
.
call
(
this
,
e
);
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -150,8 +151,8 @@ function patchDropDownKeyDownAdditional(e) { // only for formula menu when typin
...
@@ -150,8 +151,8 @@ function patchDropDownKeyDownAdditional(e) { // only for formula menu when typin
var
isActive
=
$parent
.
hasClass
(
'
open
'
)
||
$parent
.
hasClass
(
'
over
'
);
var
isActive
=
$parent
.
hasClass
(
'
open
'
)
||
$parent
.
hasClass
(
'
over
'
);
if
(
!
isActive
||
(
isActive
&&
e
.
keyCode
==
27
))
{
if
(
!
isActive
||
(
isActive
&&
e
.
keyCode
==
27
))
{
if
(
e
.
which
==
27
)
// if (e.which == 27)
$parent
.
find
(
'
[data-toggle=dropdown]
'
).
focus
();
//
$parent.find('[data-toggle=dropdown]').focus();
return
(
isActive
)
?
$this
.
click
()
:
undefined
;
return
(
isActive
)
?
$this
.
click
()
:
undefined
;
}
}
...
...
apps/spreadsheeteditor/main/app/controller/CellEditor.js
View file @
1e73c03b
...
@@ -104,14 +104,14 @@ define([
...
@@ -104,14 +104,14 @@ define([
var
me
=
this
;
var
me
=
this
;
$
(
'
#ce-cell-content
'
).
keydown
(
function
(
e
)
{
$
(
'
#ce-cell-content
'
).
keydown
(
function
(
e
)
{
if
(
Common
.
UI
.
Keys
.
ESC
===
e
.
keyCode
)
{
if
(
Common
.
UI
.
Keys
.
ESC
===
e
.
keyCode
)
{
me
.
api
.
asc_enableKeyEvents
(
true
);
//
me.api.asc_enableKeyEvents(true);
}
else
if
(
Common
.
UI
.
Keys
.
UP
===
e
.
keyCode
||
Common
.
UI
.
Keys
.
DOWN
===
e
.
keyCode
||
}
else
if
(
Common
.
UI
.
Keys
.
UP
===
e
.
keyCode
||
Common
.
UI
.
Keys
.
DOWN
===
e
.
keyCode
||
Common
.
UI
.
Keys
.
TAB
===
e
.
keyCode
||
Common
.
UI
.
Keys
.
RETURN
===
e
.
keyCode
)
{
Common
.
UI
.
Keys
.
TAB
===
e
.
keyCode
||
Common
.
UI
.
Keys
.
RETURN
===
e
.
keyCode
)
{
var
menu
=
$
(
'
#menu-formula-selection
'
);
// for formula menu
var
menu
=
$
(
'
#menu-formula-selection
'
);
// for formula menu
if
(
menu
.
hasClass
(
'
open
'
))
if
(
menu
.
hasClass
(
'
open
'
))
menu
.
find
(
'
.dropdown-menu
'
).
trigger
(
'
keydown
'
,
e
);
menu
.
find
(
'
.dropdown-menu
'
).
trigger
(
'
keydown
'
,
e
);
if
(
Common
.
UI
.
Keys
.
RETURN
===
e
.
keyCode
)
//
if (Common.UI.Keys.RETURN === e.keyCode)
me
.
api
.
asc_enableKeyEvents
(
true
);
//
me.api.asc_enableKeyEvents(true);
}
}
});
});
...
...
apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
View file @
1e73c03b
...
@@ -1450,31 +1450,31 @@ define([
...
@@ -1450,31 +1450,31 @@ define([
menu
.
onAfterKeydownMenu
=
function
(
e
)
{
menu
.
onAfterKeydownMenu
=
function
(
e
)
{
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
RETURN
&&
(
e
.
ctrlKey
||
e
.
altKey
))
return
;
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
RETURN
&&
(
e
.
ctrlKey
||
e
.
altKey
))
return
;
Common
.
UI
.
Menu
.
prototype
.
onAfterKeydownMenu
.
call
(
menu
,
e
);
//
Common.UI.Menu.prototype.onAfterKeydownMenu.call(menu, e);
var
li
;
var
li
;
if
(
arguments
.
length
>
1
&&
arguments
[
1
]
instanceof
jQuery
.
Event
)
{
// when typing in cell editor
if
(
arguments
.
length
>
1
&&
arguments
[
1
]
instanceof
jQuery
.
Event
)
// when typing in cell editor
e
=
arguments
[
1
];
e
=
arguments
[
1
];
if
(
menuContainer
.
hasClass
(
'
open
'
))
{
if
(
menuContainer
.
hasClass
(
'
open
'
))
{
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
TAB
||
e
.
keyCode
==
Common
.
UI
.
Keys
.
RETURN
&&
!
e
.
ctrlKey
&&
!
e
.
altKey
)
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
TAB
||
e
.
keyCode
==
Common
.
UI
.
Keys
.
RETURN
&&
!
e
.
ctrlKey
&&
!
e
.
altKey
)
li
=
menuContainer
.
find
(
'
a.focus
'
).
closest
(
'
li
'
);
li
=
menuContainer
.
find
(
'
a.focus
'
).
closest
(
'
li
'
);
else
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
UP
||
e
.
keyCode
==
Common
.
UI
.
Keys
.
DOWN
)
{
else
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
UP
||
e
.
keyCode
==
Common
.
UI
.
Keys
.
DOWN
)
{
var
innerEl
=
menu
.
cmpEl
,
var
innerEl
=
menu
.
cmpEl
,
inner_top
=
innerEl
.
offset
().
top
,
inner_top
=
innerEl
.
offset
().
top
,
li_focused
=
menuContainer
.
find
(
'
a.focus
'
).
closest
(
'
li
'
);
li_focused
=
menuContainer
.
find
(
'
a.focus
'
).
closest
(
'
li
'
);
var
li_top
=
li_focused
.
offset
().
top
;
var
li_top
=
li_focused
.
offset
().
top
;
if
(
li_top
<
inner_top
||
li_top
+
li_focused
.
outerHeight
()
>
inner_top
+
innerEl
.
height
())
{
if
(
li_top
<
inner_top
||
li_top
+
li_focused
.
outerHeight
()
>
inner_top
+
innerEl
.
height
())
{
if
(
menu
.
scroller
)
{
if
(
menu
.
scroller
)
{
menu
.
scroller
.
scrollTop
(
innerEl
.
scrollTop
()
+
li_top
-
inner_top
,
0
);
menu
.
scroller
.
scrollTop
(
innerEl
.
scrollTop
()
+
li_top
-
inner_top
,
0
);
}
else
{
}
else
{
innerEl
.
scrollTop
(
innerEl
.
scrollTop
()
+
li_top
-
inner_top
);
innerEl
.
scrollTop
(
innerEl
.
scrollTop
()
+
li_top
-
inner_top
);
}
}
}
}
}
}
}
}
else
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
TAB
)
}
li
=
$
(
e
.
target
).
closest
(
'
li
'
);
// } else if (e.keyCode == Common.UI.Keys.TAB)
// li = $(e.target).closest('li');
if
(
li
)
{
if
(
li
)
{
if
(
li
.
length
>
0
)
li
.
click
();
if
(
li
.
length
>
0
)
li
.
click
();
...
@@ -1505,17 +1505,17 @@ define([
...
@@ -1505,17 +1505,17 @@ define([
menu
.
scroller
.
update
({
alwaysVisibleY
:
true
});
menu
.
scroller
.
update
({
alwaysVisibleY
:
true
});
menu
.
scroller
.
scrollTop
(
0
);
menu
.
scroller
.
scrollTop
(
0
);
}
}
if
(
infocus
)
{
if
(
infocus
)
me
.
cellEditor
.
focus
();
me
.
cellEditor
.
focus
();
_
.
delay
(
function
()
{
_
.
delay
(
function
()
{
menu
.
cmpEl
.
find
(
'
li:first a
'
).
addClass
(
'
focus
'
);
menu
.
cmpEl
.
find
(
'
li:first a
'
).
addClass
(
'
focus
'
);
},
10
);
},
10
);
}
else
{
//
} else {
_
.
delay
(
function
()
{
//
_.delay(function() {
menu
.
cmpEl
.
focus
();
//
menu.cmpEl.focus();
menu
.
cmpEl
.
find
(
'
li:first a
'
).
focus
();
//
menu.cmpEl.find('li:first a').focus();
},
10
);
//
}, 10);
}
//
}
},
1
);
},
1
);
}
else
{
}
else
{
this
.
documentHolder
.
funcMenu
.
hide
();
this
.
documentHolder
.
funcMenu
.
hide
();
...
...
apps/spreadsheeteditor/main/app/controller/Main.js
View file @
1e73c03b
...
@@ -148,18 +148,9 @@ define([
...
@@ -148,18 +148,9 @@ define([
var
me
=
this
;
var
me
=
this
;
// Syncronize focus with api
// Syncronize focus with api
$
(
document
.
body
).
on
(
'
focus
'
,
'
input, textarea:not(#ce-cell-content)
'
,
function
(
e
)
{
$
(
document
.
body
).
on
(
'
focus
'
,
'
input, textarea:not(#ce-cell-content)
'
,
function
(
e
)
{
// NOTE: fix double click mozilla copy-paste
if
(
e
&&
e
.
target
&&
(
e
.
target
.
id
===
'
clipboard-helper-text
'
))
{
me
.
api
.
asc_enableKeyEvents
(
true
);
return
;
}
if
(
this
.
isAppDisabled
===
true
)
return
;
if
(
this
.
isAppDisabled
===
true
)
return
;
if
(
e
&&
e
.
target
&&
!
/area_id/
.
test
(
e
.
target
.
id
))
{
if
(
e
&&
e
.
target
&&
!
/area_id/
.
test
(
e
.
target
.
id
))
{
me
.
api
.
asc_enableKeyEvents
(
false
);
if
(
/msg-reply/
.
test
(
e
.
target
.
className
))
if
(
/msg-reply/
.
test
(
e
.
target
.
className
))
me
.
dontCloseDummyComment
=
true
;
me
.
dontCloseDummyComment
=
true
;
}
}
...
@@ -206,20 +197,20 @@ define([
...
@@ -206,20 +197,20 @@ define([
}
}
},
},
'
dataview:focus
'
:
function
(
e
){
'
dataview:focus
'
:
function
(
e
){
me
.
api
.
asc_enableKeyEvents
(
false
);
//
me.api.asc_enableKeyEvents(false);
},
},
'
dataview:blur
'
:
function
(
e
){
'
dataview:blur
'
:
function
(
e
){
if
(
!
me
.
isModalShowed
)
{
if
(
!
me
.
isModalShowed
)
{
me
.
api
.
asc_enableKeyEvents
(
true
);
//
me.api.asc_enableKeyEvents(true);
me
.
onEditComplete
();
me
.
onEditComplete
();
}
}
},
},
'
menu:show
'
:
function
(
e
){
'
menu:show
'
:
function
(
e
){
me
.
api
.
asc_enableKeyEvents
(
false
);
//
me.api.asc_enableKeyEvents(false);
},
},
'
menu:hide
'
:
function
(
e
){
'
menu:hide
'
:
function
(
e
){
if
(
!
me
.
isModalShowed
)
//
if (!me.isModalShowed)
me
.
api
.
asc_enableKeyEvents
(
true
);
//
me.api.asc_enableKeyEvents(true);
},
},
'
edit:complete
'
:
_
.
bind
(
this
.
onEditComplete
,
this
),
'
edit:complete
'
:
_
.
bind
(
this
.
onEditComplete
,
this
),
'
settings:unitschanged
'
:
_
.
bind
(
this
.
unitsChanged
,
this
)
'
settings:unitschanged
'
:
_
.
bind
(
this
.
unitsChanged
,
this
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment