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
35722617
Commit
35722617
authored
Jun 28, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DE] Добавлено меню для плагинов.
parent
55f0280b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
7 deletions
+82
-7
apps/common/main/lib/controller/Plugins.js
apps/common/main/lib/controller/Plugins.js
+66
-4
apps/common/main/lib/view/Plugins.js
apps/common/main/lib/view/Plugins.js
+7
-1
apps/documenteditor/main/app/controller/LeftMenu.js
apps/documenteditor/main/app/controller/LeftMenu.js
+8
-1
apps/documenteditor/main/app/controller/Main.js
apps/documenteditor/main/app/controller/Main.js
+1
-1
No files found.
apps/common/main/lib/controller/Plugins.js
View file @
35722617
...
...
@@ -84,8 +84,8 @@ define([
}
},
onAfterRender
:
function
(
historyView
)
{
historyView
.
viewPluginsList
.
on
(
'
item:click
'
,
_
.
bind
(
this
.
onSelectPlugin
,
this
));
onAfterRender
:
function
(
panelPlugins
)
{
panelPlugins
.
viewPluginsList
.
on
(
'
item:click
'
,
_
.
bind
(
this
.
onSelectPlugin
,
this
));
this
.
bindViewEvents
(
this
.
panelPlugins
,
this
.
events
);
},
...
...
@@ -126,9 +126,71 @@ define([
onSelectPlugin
:
function
(
picker
,
item
,
record
,
e
){
var
btn
=
$
(
e
.
target
);
if
(
btn
&&
btn
.
hasClass
(
'
plugin-caret
'
))
{
// show plugin menu
var
menu
=
this
.
panelPlugins
.
pluginMenu
;
if
(
menu
.
isVisible
())
{
menu
.
hide
();
return
;
}
var
showPoint
,
me
=
this
,
currentTarget
=
$
(
e
.
currentTarget
),
parent
=
$
(
this
.
panelPlugins
.
el
),
offset
=
currentTarget
.
offset
(),
offsetParent
=
parent
.
offset
();
showPoint
=
[
offset
.
left
-
offsetParent
.
left
+
currentTarget
.
width
(),
offset
.
top
-
offsetParent
.
top
+
currentTarget
.
height
()
/
2
];
if
(
record
!=
undefined
)
{
for
(
var
i
=
0
;
i
<
menu
.
items
.
length
;
i
++
)
{
menu
.
removeItem
(
menu
.
items
[
i
]);
i
--
;
}
menu
.
removeAll
();
var
variations
=
record
.
get
(
'
variations
'
);
for
(
var
i
=
0
;
i
<
variations
.
length
;
i
++
)
{
var
variation
=
variations
[
i
],
mnu
=
new
Common
.
UI
.
MenuItem
({
caption
:
variation
.
get
(
'
description
'
),
value
:
parseInt
(
variation
.
get
(
'
index
'
))
}).
on
(
'
click
'
,
function
(
item
,
e
)
{
if
(
me
.
api
)
{
me
.
api
.
asc_pluginRun
(
record
.
get
(
'
guid
'
),
item
.
value
,
''
);
}
});
menu
.
addItem
(
mnu
);
}
}
var
menuContainer
=
parent
.
find
(
'
#menu-plugin-container
'
);
if
(
!
menu
.
rendered
)
{
if
(
menuContainer
.
length
<
1
)
{
menuContainer
=
$
(
'
<div id="menu-plugin-container" style="position: absolute; z-index: 10000;"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>
'
,
menu
.
id
);
parent
.
append
(
menuContainer
);
}
menu
.
render
(
menuContainer
);
menu
.
cmpEl
.
attr
({
tabindex
:
"
-1
"
});
menu
.
on
(
'
show:after
'
,
function
(
cmp
)
{
if
(
cmp
&&
cmp
.
menuAlignEl
)
cmp
.
menuAlignEl
.
toggleClass
(
'
over
'
,
true
);
}).
on
(
'
hide:after
'
,
function
(
cmp
)
{
if
(
cmp
&&
cmp
.
menuAlignEl
)
cmp
.
menuAlignEl
.
toggleClass
(
'
over
'
,
false
);
});
}
menuContainer
.
css
({
left
:
showPoint
[
0
],
top
:
showPoint
[
1
]});
menu
.
menuAlignEl
=
currentTarget
;
menu
.
setOffset
(
-
11
,
-
currentTarget
.
height
()
/
2
+
2
);
menu
.
show
();
_
.
delay
(
function
()
{
menu
.
cmpEl
.
focus
();
},
10
);
e
.
stopPropagation
();
e
.
preventDefault
();
}
else
this
.
api
.
asc_pluginRun
(
record
.
get
(
'
guid
'
),
record
.
get
(
'
currentVariation
'
)
,
''
);
this
.
api
.
asc_pluginRun
(
record
.
get
(
'
guid
'
),
0
,
''
);
},
onPluginShow
:
function
(
plugin
)
{
...
...
apps/common/main/lib/view/Plugins.js
View file @
35722617
...
...
@@ -50,7 +50,7 @@ define([
'
use strict
'
;
Common
.
Views
.
Plugins
=
Common
.
UI
.
BaseView
.
extend
(
_
.
extend
({
el
:
'
#
id-plugins-setting
s
'
,
el
:
'
#
left-panel-plugin
s
'
,
storePlugins
:
undefined
,
template
:
_
.
template
([
...
...
@@ -100,11 +100,17 @@ define([
].
join
(
''
))
});
this
.
lockedControls
.
push
(
this
.
viewPluginsList
);
this
.
viewPluginsList
.
cmpEl
.
off
(
'
click
'
);
this
.
pluginName
=
$
(
'
#current-plugin-header label
'
);
this
.
pluginsPanel
=
$
(
'
#plugins-box
'
);
this
.
currentPluginPanel
=
$
(
'
#current-plugin-box
'
);
this
.
pluginMenu
=
new
Common
.
UI
.
Menu
({
menuAlign
:
'
tr-br
'
,
items
:
[]
});
this
.
trigger
(
'
render:after
'
,
this
);
return
this
;
},
...
...
apps/documenteditor/main/app/controller/LeftMenu.js
View file @
35722617
...
...
@@ -558,7 +558,14 @@ define([
$
.
fn
.
dropdown
.
Constructor
.
prototype
.
keydown
.
call
(
menu_opened
[
0
],
e
);
return
false
;
}
if
(
this
.
leftMenu
.
btnFile
.
pressed
||
this
.
leftMenu
.
btnAbout
.
pressed
||
if
(
this
.
mode
.
canPlugins
&&
this
.
leftMenu
.
panelPlugins
)
{
menu_opened
=
this
.
leftMenu
.
panelPlugins
.
$el
.
find
(
'
#menu-plugin-container.open > [data-toggle="dropdown"]
'
);
if
(
menu_opened
.
length
)
{
$
.
fn
.
dropdown
.
Constructor
.
prototype
.
keydown
.
call
(
menu_opened
[
0
],
e
);
return
false
;
}
}
if
(
this
.
leftMenu
.
btnFile
.
pressed
||
this
.
leftMenu
.
btnAbout
.
pressed
||
this
.
leftMenu
.
btnPlugins
.
pressed
||
$
(
e
.
target
).
parents
(
'
#left-menu
'
).
length
)
{
this
.
leftMenu
.
close
();
Common
.
NotificationCenter
.
trigger
(
'
layout:changed
'
,
'
leftmenu
'
);
...
...
apps/documenteditor/main/app/controller/Main.js
View file @
35722617
...
...
@@ -1719,7 +1719,7 @@ define([
if
(
isSupported
&&
(
isEdit
||
itemVar
.
isViewer
))
variationsArr
.
push
(
new
Common
.
Models
.
PluginVariation
({
description
:
itemVar
.
description
,
index
:
itemVar
.
index
,
index
:
variationsArr
.
length
,
url
:
itemVar
.
url
,
icons
:
itemVar
.
icons
,
isViewer
:
itemVar
.
isViewer
,
...
...
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