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
35073c90
Commit
35073c90
authored
Dec 21, 2016
by
Maxim Kadushkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE mobile] open Function panel for CellEditor
parent
0496f3ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
75 deletions
+82
-75
apps/spreadsheeteditor/mobile/app/controller/CellEditor.js
apps/spreadsheeteditor/mobile/app/controller/CellEditor.js
+14
-15
apps/spreadsheeteditor/mobile/app/controller/add/AddContainer.js
...readsheeteditor/mobile/app/controller/add/AddContainer.js
+63
-58
apps/spreadsheeteditor/mobile/app/view/CellEditor.js
apps/spreadsheeteditor/mobile/app/view/CellEditor.js
+5
-2
No files found.
apps/spreadsheeteditor/mobile/app/controller/CellEditor.js
View file @
35073c90
...
...
@@ -51,22 +51,24 @@ define([
'
CellEditor
'
],
//
events: function() {
//
return {
events
:
function
()
{
return
{
// 'keyup input#ce-cell-name': _.bind(this.onCellName,this),
// 'keyup textarea#ce-cell-content': _.bind(this.onKeyupCellEditor,this),
// 'blur textarea#ce-cell-content': _.bind(this.onBlurCellEditor,this),
// 'click
button#ce-func-label
': _.bind(this.onInsertFunction, this)
//
};
//
},
// 'click
a#ce-function
': _.bind(this.onInsertFunction, this)
};
},
initialize
:
function
()
{
// this.addListeners({
// 'CellEditor': {},
this
.
addListeners
({
'
CellEditor
'
:
{
'
function:click
'
:
this
.
onInsertFunction
.
bind
(
this
)
}
// 'Viewport': {
// 'layout:resizedrag': _.bind(this.onLayoutResize, this)
// }
//
});
});
},
setApi
:
function
(
api
)
{
...
...
@@ -168,13 +170,10 @@ define([
},
onInsertFunction
:
function
()
{
if
(
this
.
mode
.
isEdit
&&
!
this
.
editor
.
$btnfunc
[
'
hasClass
'
](
'
disabled
'
))
{
var
controller
=
this
.
getApplication
().
getController
(
'
FormulaDialog
'
);
if
(
controller
)
{
$
(
'
#ce-func-label
'
,
this
.
editor
.
el
).
blur
();
controller
.
showDialog
();
}
}
SSE
.
getController
(
'
AddContainer
'
).
showModal
({
panel
:
'
function
'
,
button
:
'
#ce-function
'
});
}
});
});
\ No newline at end of file
apps/spreadsheeteditor/mobile/app/controller/add/AddContainer.js
View file @
35073c90
...
...
@@ -51,6 +51,9 @@ define([
SSE
.
Controllers
.
AddContainer
=
Backbone
.
Controller
.
extend
(
_
.
extend
((
function
()
{
// private
var
parentButton
=
null
,
options
;
return
{
models
:
[],
collections
:
[],
...
...
@@ -68,7 +71,7 @@ define([
//
},
showModal
:
function
()
{
showModal
:
function
(
opts
)
{
var
me
=
this
;
if
(
$$
(
'
.container-add.modal-in
'
).
length
>
0
)
{
...
...
@@ -77,8 +80,11 @@ define([
uiApp
.
closeModal
();
options
=
opts
;
parentButton
=
!
opts
?
'
#toolbar-add
'
:
opts
.
button
;
me
.
_showByStack
(
Common
.
SharedSettings
.
get
(
'
phone
'
));
this
.
api
.
asc_closeCellEditor
();
SSE
.
getController
(
'
Toolbar
'
).
getView
(
'
Toolbar
'
).
hideSearch
();
},
...
...
@@ -88,47 +94,39 @@ define([
}
},
_dummyEditController
:
function
()
{
var
layout
=
'
<div class="content-block inset">
'
+
'
<div class="content-block-inner">
'
+
'
<p>Under Construction</p>
'
+
'
</div>
'
+
'
</div>
'
;
return
{
getCaption
:
function
()
{
return
'
Dummy
'
},
getLayout
:
function
()
{
return
layout
}
}
},
_layoutEditorsByStack
:
function
()
{
var
me
=
this
,
addViews
=
[];
addViews
.
push
({
caption
:
me
.
textChart
,
id
:
'
add-chart
'
,
layout
:
SSE
.
getController
(
'
AddChart
'
).
getView
(
'
AddChart
'
).
rootLayout
()
});
// var seltype = this.api.asc_getCellInfo().asc_getFlags().asc_getSelectionType();
addViews
.
push
({
caption
:
me
.
textFormula
,
id
:
'
add-formula
'
,
layout
:
SSE
.
getController
(
'
AddFunction
'
).
getView
(
'
AddFunction
'
).
rootLayout
()
});
if
(
!
options
)
addViews
.
push
({
caption
:
me
.
textChart
,
id
:
'
add-chart
'
,
layout
:
SSE
.
getController
(
'
AddChart
'
).
getView
(
'
AddChart
'
).
rootLayout
()
});
addViews
.
push
({
caption
:
me
.
textShape
,
id
:
'
add-shape
'
,
layout
:
SSE
.
getController
(
'
AddShape
'
).
getView
(
'
AddShape
'
).
rootLayout
()
});
if
(
!
options
||
options
.
panel
==
'
function
'
)
addViews
.
push
({
caption
:
me
.
textFormula
,
id
:
'
add-formula
'
,
layout
:
SSE
.
getController
(
'
AddFunction
'
).
getView
(
'
AddFunction
'
).
rootLayout
()
});
addViews
.
push
({
caption
:
me
.
textOther
,
id
:
'
add-other
'
,
layout
:
SSE
.
getController
(
'
AddOther
'
).
getView
(
'
AddOther
'
).
rootLayout
()
});
if
(
!
options
)
addViews
.
push
({
caption
:
me
.
textShape
,
id
:
'
add-shape
'
,
layout
:
SSE
.
getController
(
'
AddShape
'
).
getView
(
'
AddShape
'
).
rootLayout
()
});
if
(
!
options
)
addViews
.
push
({
caption
:
me
.
textOther
,
id
:
'
add-other
'
,
layout
:
SSE
.
getController
(
'
AddOther
'
).
getView
(
'
AddOther
'
).
rootLayout
()
});
return
addViews
;
},
...
...
@@ -153,33 +151,40 @@ define([
);
if
(
isAndroid
)
{
if
(
layoutAdds
.
length
<
2
)
{
$layoutNavbar
.
find
(
'
.center
'
)
.
append
(
'
<div class="toolbar tabbar"><div data-page="index" class="toolbar-inner"></div></div>
'
);
_
.
each
(
layoutAdds
,
function
(
layout
,
index
)
{
.
removeClass
(
'
categories
'
)
.
html
(
layoutAdds
[
0
].
caption
);
}
else
{
if
(
isAndroid
)
{
$layoutNavbar
.
find
(
'
.center
'
)
.
append
(
'
<div class="toolbar tabbar"><div data-page="index" class="toolbar-inner"></div></div>
'
);
_
.
each
(
layoutAdds
,
function
(
layout
,
index
)
{
$layoutNavbar
.
find
(
'
.toolbar-inner
'
)
.
append
(
'
<a href="#
'
+
layout
.
id
+
'
" class="tab-link
'
+
(
index
<
1
?
'
active
'
:
''
)
+
'
">
'
+
layout
.
caption
+
'
</a>
'
);
});
$layoutNavbar
.
find
(
'
.toolbar-inner
'
)
.
append
(
'
<a href="#
'
+
layout
.
id
+
'
" class="tab-link
'
+
(
index
<
1
?
'
active
'
:
''
)
+
'
">
'
+
layout
.
caption
+
'
</a>
'
);
});
$layoutNavbar
.
find
(
'
.toolbar-inner
'
)
.
append
(
'
<span class="tab-link-highlight" style="width:
'
+
(
100
/
layoutAdds
.
length
)
+
'
%;"></span>
'
);
}
else
{
$layoutNavbar
.
find
(
'
.center
'
)
.
append
(
'
<div class="buttons-row"></div>
'
);
_
.
each
(
layoutAdds
,
function
(
layout
,
index
)
{
.
append
(
'
<span class="tab-link-highlight" style="width:
'
+
(
100
/
layoutAdds
.
length
)
+
'
%;"></span>
'
);
}
else
{
$layoutNavbar
.
find
(
'
.buttons-row
'
)
.
append
(
'
<a href="#
'
+
layout
.
id
+
'
" class="tab-link button
'
+
(
index
<
1
?
'
active
'
:
''
)
+
'
">
'
+
layout
.
caption
+
'
</a>
'
);
});
.
find
(
'
.center
'
)
.
append
(
'
<div class="buttons-row"></div>
'
);
_
.
each
(
layoutAdds
,
function
(
layout
,
index
)
{
$layoutNavbar
.
find
(
'
.buttons-row
'
)
.
append
(
'
<a href="#
'
+
layout
.
id
+
'
" class="tab-link button
'
+
(
index
<
1
?
'
active
'
:
''
)
+
'
">
'
+
layout
.
caption
+
'
</a>
'
);
});
}
}
...
...
@@ -232,7 +237,7 @@ define([
'
</div>
'
+
'
</div>
'
+
'
</div>
'
,
$$
(
'
#toolbar-add
'
)
$$
(
parentButton
)
);
// Prevent hide overlay. Conflict popover and modals.
...
...
apps/spreadsheeteditor/mobile/app/view/CellEditor.js
View file @
35073c90
...
...
@@ -52,7 +52,10 @@ define([
template
:
_
.
template
(
template
),
events
:
{
'
click button#ce-btn-expand
'
:
'
expandEditor
'
'
click button#ce-btn-expand
'
:
'
expandEditor
'
,
'
click #ce-function
'
:
function
(
e
)
{
this
.
fireEvent
(
'
function:click
'
,
this
);
}
},
initialize
:
function
(
options
)
{
...
...
@@ -64,7 +67,7 @@ define([
this
.
$cellname
=
$
(
'
#ce-cell-name
'
,
this
.
el
);
this
.
$btnexpand
=
$
(
'
#ce-btn-expand
'
,
this
.
el
);
// this.$btnfunc = $('#ce-func
-label
', this.el);
// this.$btnfunc = $('#ce-func
tion
', this.el);
return
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