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
58c3fd33
Commit
58c3fd33
authored
Aug 03, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select non-visual plugin when it starts.
parent
d1ea727e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
37 deletions
+51
-37
apps/common/main/lib/controller/Plugins.js
apps/common/main/lib/controller/Plugins.js
+37
-34
apps/common/main/lib/view/Plugins.js
apps/common/main/lib/view/Plugins.js
+10
-0
apps/common/main/resources/less/plugins.less
apps/common/main/resources/less/plugins.less
+4
-3
No files found.
apps/common/main/lib/controller/Plugins.js
View file @
58c3fd33
...
...
@@ -219,49 +219,52 @@ define([
onPluginShow
:
function
(
plugin
,
variationIndex
)
{
var
variation
=
plugin
.
get_Variations
()[
variationIndex
];
if
(
!
variation
.
get_Visual
())
return
;
if
(
variation
.
get_InsideMode
())
{
this
.
panelPlugins
.
openInsideMode
(
plugin
.
get_Name
(),
((
plugin
.
get_BaseUrl
().
length
==
0
)
?
this
.
panelPlugins
.
pluginsPath
:
plugin
.
get_BaseUrl
())
+
variation
.
get_Url
());
}
else
{
var
me
=
this
,
arrBtns
=
variation
.
get_Buttons
(),
newBtns
=
{},
size
=
variation
.
get_Size
();
if
(
!
size
||
size
.
length
<
2
)
size
=
[
800
,
600
];
if
(
variation
.
get_Visual
())
{
if
(
variation
.
get_InsideMode
())
{
this
.
panelPlugins
.
openInsideMode
(
plugin
.
get_Name
(),
((
plugin
.
get_BaseUrl
().
length
==
0
)
?
this
.
panelPlugins
.
pluginsPath
:
plugin
.
get_BaseUrl
())
+
variation
.
get_Url
());
}
else
{
var
me
=
this
,
arrBtns
=
variation
.
get_Buttons
(),
newBtns
=
{},
size
=
variation
.
get_Size
();
if
(
!
size
||
size
.
length
<
2
)
size
=
[
800
,
600
];
if
(
_
.
isArray
(
arrBtns
))
{
_
.
each
(
arrBtns
,
function
(
b
,
index
){
newBtns
[
index
]
=
{
text
:
b
.
text
,
cls
:
'
custom
'
+
((
b
.
primary
)
?
'
primary
'
:
''
)};
if
(
_
.
isArray
(
arrBtns
))
{
_
.
each
(
arrBtns
,
function
(
b
,
index
){
newBtns
[
index
]
=
{
text
:
b
.
text
,
cls
:
'
custom
'
+
((
b
.
primary
)
?
'
primary
'
:
''
)};
});
}
var
_baseUrl
=
(
plugin
.
get_BaseUrl
().
length
==
0
)
?
me
.
panelPlugins
.
pluginsPath
:
plugin
.
get_BaseUrl
();
me
.
pluginDlg
=
new
Common
.
Views
.
PluginDlg
({
title
:
plugin
.
get_Name
(),
width
:
size
[
0
],
// inner width
height
:
size
[
1
],
// inner height
url
:
_baseUrl
+
variation
.
get_Url
(),
buttons
:
newBtns
,
toolcallback
:
_
.
bind
(
this
.
onToolClose
,
this
)
});
me
.
pluginDlg
.
on
(
'
render:after
'
,
function
(
obj
){
obj
.
getChild
(
'
.footer .dlg-btn
'
).
on
(
'
click
'
,
_
.
bind
(
me
.
onDlgBtnClick
,
me
));
me
.
pluginContainer
=
me
.
pluginDlg
.
$window
.
find
(
'
#id-plugin-container
'
);
}).
on
(
'
close
'
,
function
(
obj
){
me
.
pluginDlg
=
undefined
;
}).
on
(
'
drag
'
,
function
(
args
){
me
.
api
.
asc_pluginEnableMouseEvents
(
args
[
1
]
==
'
start
'
);
});
me
.
pluginDlg
.
show
();
}
var
_baseUrl
=
(
plugin
.
get_BaseUrl
().
length
==
0
)
?
me
.
panelPlugins
.
pluginsPath
:
plugin
.
get_BaseUrl
();
me
.
pluginDlg
=
new
Common
.
Views
.
PluginDlg
({
title
:
plugin
.
get_Name
(),
width
:
size
[
0
],
// inner width
height
:
size
[
1
],
// inner height
url
:
_baseUrl
+
variation
.
get_Url
(),
buttons
:
newBtns
,
toolcallback
:
_
.
bind
(
this
.
onToolClose
,
this
)
});
me
.
pluginDlg
.
on
(
'
render:after
'
,
function
(
obj
){
obj
.
getChild
(
'
.footer .dlg-btn
'
).
on
(
'
click
'
,
_
.
bind
(
me
.
onDlgBtnClick
,
me
));
me
.
pluginContainer
=
me
.
pluginDlg
.
$window
.
find
(
'
#id-plugin-container
'
);
}).
on
(
'
close
'
,
function
(
obj
){
me
.
pluginDlg
=
undefined
;
}).
on
(
'
drag
'
,
function
(
args
){
me
.
api
.
asc_pluginEnableMouseEvents
(
args
[
1
]
==
'
start
'
);
});
me
.
pluginDlg
.
show
();
}
}
else
this
.
panelPlugins
.
openNotVisualMode
(
plugin
.
get_Guid
());
},
onPluginClose
:
function
()
{
if
(
this
.
pluginDlg
)
this
.
pluginDlg
.
close
();
else
else
if
(
this
.
panelPlugins
.
iframePlugin
)
this
.
panelPlugins
.
closeInsideMode
();
else
this
.
panelPlugins
.
closeNotVisualMode
();
},
onPluginResize
:
function
(
width
,
height
,
callback
)
{
...
...
apps/common/main/lib/view/Plugins.js
View file @
58c3fd33
...
...
@@ -172,6 +172,16 @@ define([
this
.
pluginsPanel
.
toggleClass
(
'
hidden
'
,
false
);
},
openNotVisualMode
:
function
(
pluginGuid
)
{
var
rec
=
this
.
viewPluginsList
.
store
.
findWhere
({
guid
:
pluginGuid
});
if
(
rec
)
this
.
viewPluginsList
.
cmpEl
.
find
(
'
#
'
+
rec
.
get
(
'
id
'
)).
parent
().
addClass
(
'
selected
'
);
},
closeNotVisualMode
:
function
()
{
this
.
viewPluginsList
.
cmpEl
.
find
(
'
.selected
'
).
removeClass
(
'
selected
'
);
},
_onLoad
:
function
()
{
if
(
this
.
loadMask
)
this
.
loadMask
.
hide
();
...
...
apps/common/main/resources/less/plugins.less
View file @
58c3fd33
...
...
@@ -27,10 +27,11 @@
&:hover,
&.over {
background-color: @secondary;
}
.plugin-icon
{
.box-shadow(0 0 0 2px transparent)
;
}
&.selected
{
background-color: @primary
;
color: #fff;
}
}
...
...
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