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
7c5a886a
Commit
7c5a886a
authored
Dec 01, 2016
by
Maxim Kadushkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SSE mobile] created view for CellEditor controller
parent
d629c1cb
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
149 additions
and
63 deletions
+149
-63
apps/spreadsheeteditor/mobile/app/controller/CellEditor.js
apps/spreadsheeteditor/mobile/app/controller/CellEditor.js
+18
-50
apps/spreadsheeteditor/mobile/app/template/CellEditor.template
...spreadsheeteditor/mobile/app/template/CellEditor.template
+12
-0
apps/spreadsheeteditor/mobile/app/template/Editor.template
apps/spreadsheeteditor/mobile/app/template/Editor.template
+1
-13
apps/spreadsheeteditor/mobile/app/view/CellEditor.js
apps/spreadsheeteditor/mobile/app/view/CellEditor.js
+99
-0
apps/spreadsheeteditor/mobile/resources/less/app-common.less
apps/spreadsheeteditor/mobile/resources/less/app-common.less
+14
-0
apps/spreadsheeteditor/mobile/resources/less/celleditor.less
apps/spreadsheeteditor/mobile/resources/less/celleditor.less
+5
-0
No files found.
apps/spreadsheeteditor/mobile/app/controller/CellEditor.js
View file @
7c5a886a
...
@@ -36,36 +36,37 @@
...
@@ -36,36 +36,37 @@
* CellEditor Controller
* CellEditor Controller
*
*
* Created by Maxim Kadushkin on 11/24/2016
* Created by Maxim Kadushkin on 11/24/2016
* Copyright (c) 201
4
Ascensio System SIA. All rights reserved.
* Copyright (c) 201
6
Ascensio System SIA. All rights reserved.
*
*
*/
*/
define
([
define
([
'
core
'
'
core
'
,
],
function
(
Viewport
)
{
'
spreadsheeteditor/mobile/app/view/CellEditor
'
],
function
(
core
)
{
'
use strict
'
;
'
use strict
'
;
SSE
.
Controllers
.
CellEditor
=
Backbone
.
Controller
.
extend
({
SSE
.
Controllers
.
CellEditor
=
Backbone
.
Controller
.
extend
({
defEditorHeight
:
30
,
views
:
[
maxEditorHeight
:
70
,
'
CellEditor
'
],
events
:
function
()
{
//
events: function() {
return
{
//
return {
// 'keyup input#ce-cell-name': _.bind(this.onCellName,this),
// 'keyup input#ce-cell-name': _.bind(this.onCellName,this),
// 'keyup textarea#ce-cell-content': _.bind(this.onKeyupCellEditor,this),
// 'keyup textarea#ce-cell-content': _.bind(this.onKeyupCellEditor,this),
// 'blur textarea#ce-cell-content': _.bind(this.onBlurCellEditor,this),
// 'blur textarea#ce-cell-content': _.bind(this.onBlurCellEditor,this),
'
click button#ce-btn-expand
'
:
_
.
bind
(
this
.
expandEditorField
,
this
),
// 'click button#ce-func-label': _.bind(this.onInsertFunction, this)
// 'click button#ce-func-label': _.bind(this.onInsertFunction, this)
};
//
};
},
//
},
initialize
:
function
()
{
initialize
:
function
()
{
this
.
addListeners
({
//
this.addListeners({
'
CellEditor
'
:
{},
//
'CellEditor': {},
'
Viewport
'
:
{
//
'Viewport': {
// 'layout:resizedrag': _.bind(this.onLayoutResize, this)
// 'layout:resizedrag': _.bind(this.onLayoutResize, this)
}
//
}
});
//
});
},
},
setApi
:
function
(
api
)
{
setApi
:
function
(
api
)
{
...
@@ -100,11 +101,7 @@ define([
...
@@ -100,11 +101,7 @@ define([
},
},
onLaunch
:
function
()
{
onLaunch
:
function
()
{
this
.
editor
=
{
$el
:
$
(
'
#cell-editing-box
'
)
};
this
.
editor
=
this
.
createView
(
'
CellEditor
'
).
render
();
this
.
editor
.
$el
.
height
(
this
.
defEditorHeight
);
this
.
editor
.
$btnexpand
=
this
.
editor
.
$el
.
find
(
'
#ce-btn-expand
'
);
this
.
editor
.
$btnexpand
.
on
(
'
click
'
,
this
.
expandEditorField
.
bind
(
this
));
// this.bindViewEvents(this.editor, this.events);
// this.bindViewEvents(this.editor, this.events);
// this.editor.$el.parent().find('.after').css({zIndex: '4'}); // for spreadsheets - bug 23127
// this.editor.$el.parent().find('.after').css({zIndex: '4'}); // for spreadsheets - bug 23127
...
@@ -122,12 +119,7 @@ define([
...
@@ -122,12 +119,7 @@ define([
},
},
onApiCellSelection
:
function
(
info
)
{
onApiCellSelection
:
function
(
info
)
{
if
(
info
)
{
this
.
editor
.
updateCellInfo
(
info
);
if
(
!
this
.
editor
.
$cellname
)
this
.
editor
.
$cellname
=
this
.
editor
.
$el
.
find
(
'
#ce-cell-name
'
);
this
.
editor
.
$cellname
.
html
(
typeof
(
info
)
==
'
string
'
?
info
:
info
.
asc_getName
());
}
},
},
onApiDisconnect
:
function
()
{
onApiDisconnect
:
function
()
{
...
@@ -148,17 +140,6 @@ define([
...
@@ -148,17 +140,6 @@ define([
// this.editor.cellNameDisabled(status != Asc.c_oAscSelectionDialogType.None);
// this.editor.cellNameDisabled(status != Asc.c_oAscSelectionDialogType.None);
},
},
onLayoutResize
:
function
(
o
,
r
)
{
if
(
r
==
'
cell:edit
'
)
{
if
(
this
.
editor
.
$el
.
height
()
>
19
)
{
if
(
!
this
.
editor
.
$btnexpand
.
hasClass
(
'
btn-collapse
'
))
this
.
editor
.
$btnexpand
[
'
addClass
'
](
'
btn-collapse
'
);
}
else
{
this
.
editor
.
$btnexpand
[
'
removeClass
'
](
'
btn-collapse
'
);
}
}
},
onCellName
:
function
(
e
)
{
onCellName
:
function
(
e
)
{
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
RETURN
){
if
(
e
.
keyCode
==
Common
.
UI
.
Keys
.
RETURN
){
var
name
=
this
.
editor
.
$cellname
.
val
();
var
name
=
this
.
editor
.
$cellname
.
val
();
...
@@ -186,19 +167,6 @@ define([
...
@@ -186,19 +167,6 @@ define([
}
}
},
},
expandEditorField
:
function
()
{
if
(
this
.
editor
.
$el
.
height
()
>
this
.
defEditorHeight
)
{
this
.
editor
.
$el
.
height
(
this
.
defEditorHeight
);
this
.
editor
.
$btnexpand
.
removeClass
(
'
collapse
'
);
}
else
{
this
.
editor
.
$el
.
height
(
this
.
maxEditorHeight
);
this
.
editor
.
$btnexpand
.
addClass
(
'
collapse
'
);
}
// Common.NotificationCenter.trigger('layout:changed', 'celleditor');
// Common.NotificationCenter.trigger('edit:complete', this.editor, {restorefocus:true});
},
onInsertFunction
:
function
()
{
onInsertFunction
:
function
()
{
if
(
this
.
mode
.
isEdit
&&
!
this
.
editor
.
$btnfunc
[
'
hasClass
'
](
'
disabled
'
))
{
if
(
this
.
mode
.
isEdit
&&
!
this
.
editor
.
$btnfunc
[
'
hasClass
'
](
'
disabled
'
))
{
var
controller
=
this
.
getApplication
().
getController
(
'
FormulaDialog
'
);
var
controller
=
this
.
getApplication
().
getController
(
'
FormulaDialog
'
);
...
...
apps/spreadsheeteditor/mobile/app/template/CellEditor.template
0 → 100644
View file @
7c5a886a
<div id="cell-editing-box">
<div class="ce-group group-name">
<span id="ce-cell-name"></span>
<button id="ce-func-label" type="button" class="btn"><span class="btn-icon">ƒ₍ₓ₎</span></button>
</div>
<div class="ce-group group-content">
<textarea id="ce-cell-content" spellcheck="false" rows="1" cols="20"></textarea>
</div>
<div class="ce-group group-expand">
<button id="ce-btn-expand" type="button" class="btn"><span class="caret">❯</span></button>
</div>
</div>
apps/spreadsheeteditor/mobile/app/template/Editor.template
View file @
7c5a886a
<div class="views">
<div class="views">
<div class="view view-main">
<div class="view view-main">
<div class="pages navbar-through">
<div class="pages navbar-through">
<div data-page="index" class="page">
<div data-page="index" class="page flex-horizontal">
<div id="cell-editing-box">
<div class="ce-group group-name">
<span id="ce-cell-name"></span>
<button id="ce-func-label" type="button" class="btn"><span class="btn-icon">ƒ₍ₓ₎</span></button>
</div>
<div class="ce-group group-content">
<textarea id="ce-cell-content" spellcheck="false" rows="1" cols="20"></textarea>
</div>
<div class="ce-group group-expand">
<button id="ce-btn-expand" type="button" class="btn"><span class="caret">❯</span></button>
</div>
</div>
<div id="editor_sdk" class="page-content no-fastclick">
<div id="editor_sdk" class="page-content no-fastclick">
</div>
</div>
</div>
</div>
...
...
apps/spreadsheeteditor/mobile/app/view/CellEditor.js
0 → 100644
View file @
7c5a886a
/*
*
* (c) Copyright Ascensio System Limited 2010-2016
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
/**
* CellEdit.js
*
* Created by Maxim Kadushkin on 11/28/2016
* Copyright (c) 2016 Ascensio System SIA. All rights reserved.
*
*/
define
([
'
text!spreadsheeteditor/mobile/app/template/CellEditor.template
'
,
'
backbone
'
],
function
(
template
,
Backbone
)
{
'
use strict
'
;
SSE
.
Views
.
CellEditor
=
Backbone
.
View
.
extend
({
defEditorHeight
:
30
,
maxEditorHeight
:
70
,
el
:
'
.pages > .page
'
,
template
:
_
.
template
(
template
),
events
:
{
'
click button#ce-btn-expand
'
:
'
expandEditor
'
},
initialize
:
function
(
options
)
{
},
render
:
function
()
{
var
$el
=
$
(
this
.
el
);
this
.
$el
=
$
(
this
.
template
()).
prependTo
(
$el
);
this
.
$cellname
=
$
(
'
#ce-cell-name
'
,
this
.
el
);
this
.
$btnexpand
=
$
(
'
#ce-btn-expand
'
,
this
.
el
);
// this.$btnfunc = $('#ce-func-label', this.el);
// this.$el.height(this.defEditorHeight);
return
this
;
},
updateCellInfo
:
function
(
info
)
{
if
(
info
)
{
this
.
$cellname
.
html
(
typeof
(
info
)
==
'
string
'
?
info
:
info
.
asc_getName
());
}
},
expandEditor
:
function
()
{
if
(
this
.
$el
.
height
()
>
this
.
defEditorHeight
)
{
this
.
$el
.
height
(
this
.
defEditorHeight
);
this
.
$btnexpand
.
removeClass
(
'
collapse
'
);
}
else
{
this
.
$el
.
height
(
this
.
maxEditorHeight
);
this
.
$btnexpand
.
addClass
(
'
collapse
'
);
}
// Common.NotificationCenter.trigger('layout:changed', 'celleditor');
// Common.NotificationCenter.trigger('edit:complete', this.editor, {restorefocus:true});
},
cellNameDisabled
:
function
(
disabled
){
// (disabled) ? this.$cellname.attr('disabled', 'disabled') : this.$cellname.removeAttr('disabled');
// this.$btnfunc.toggleClass('disabled', disabled);
// this.btnNamedRanges.setDisabled(disabled);
}
});
});
apps/spreadsheeteditor/mobile/resources/less/app-common.less
View file @
7c5a886a
@appStatusbarHeight: 30px;
.navbar-through {
.navbar-through {
> .page {
> .page {
padding-top: @appToolbarHeight;
padding-top: @appToolbarHeight;
}
}
}
}
.flex-horizontal {
display: flex;
flex-direction: column;
align-items: stretch;
}
.flex-vertical {
display: flex;
flex-direction: row;
align-items: stretch;
}
apps/spreadsheeteditor/mobile/resources/less/celleditor.less
View file @
7c5a886a
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
}
}
#cell-editing-box {
#cell-editing-box {
box-sizing: border-box;
* {
* {
box-sizing: border-box;
box-sizing: border-box;
}
}
...
@@ -18,6 +19,7 @@
...
@@ -18,6 +19,7 @@
background-color: #fff;
background-color: #fff;
display: flex;
display: flex;
align-items: stretch;
align-items: stretch;
overflow: hidden;
.btn {
.btn {
border: 0 none;
border: 0 none;
...
@@ -26,6 +28,7 @@
...
@@ -26,6 +28,7 @@
}
}
.ce-group {
.ce-group {
overflow: hidden;
}
}
.group-name {
.group-name {
...
@@ -88,12 +91,14 @@
...
@@ -88,12 +91,14 @@
.caret {
.caret {
display: block;
display: block;
transform: rotate(90deg);
transform: rotate(90deg);
transition: transform 0.1s ease;
font-size: 16px;
font-size: 16px;
}
}
&.collapse {
&.collapse {
.caret {
.caret {
transform: rotate(-90deg);
transform: rotate(-90deg);
transition: transform 0.1s ease;
}
}
}
}
}
}
...
...
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