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
ee3e78fd
Commit
ee3e78fd
authored
Mar 17, 2016
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DE] Добавлена настройка ширины таблицы в процентах.
parent
76105ffb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
12 deletions
+56
-12
apps/documenteditor/main/app/template/TableSettingsAdvanced.template
...nteditor/main/app/template/TableSettingsAdvanced.template
+9
-4
apps/documenteditor/main/app/view/DocumentHolder.js
apps/documenteditor/main/app/view/DocumentHolder.js
+1
-0
apps/documenteditor/main/app/view/TableSettings.js
apps/documenteditor/main/app/view/TableSettings.js
+1
-0
apps/documenteditor/main/app/view/TableSettingsAdvanced.js
apps/documenteditor/main/app/view/TableSettingsAdvanced.js
+45
-8
No files found.
apps/documenteditor/main/app/template/TableSettingsAdvanced.template
View file @
ee3e78fd
<div id="id-adv-table-width" class="settings-panel active">
<div class="inner-content">
<table cols="
2
" style="width: 100%;">
<table cols="
1
" style="width: 100%;">
<tr>
<td class="padding-small" width="125px">
<div id="tableadv-checkbox-width"></div>
</td>
</tr>
<tr>
<td class="padding-large">
<div id="tableadv-number-width" style="display: inline-block; margin-right: 10px;"></div>
<div id="tableadv-cmb-unit" style="display: inline-block;"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="tableadv-checkbox-spacing"></div>
</td>
</tr>
<tr>
<td class="padding-large">
<div id="tableadv-number-width"></div>
</td>
<td class="padding-large">
<div id="tableadv-number-spacing"></div>
</td>
...
...
apps/documenteditor/main/app/view/DocumentHolder.js
View file @
ee3e78fd
...
...
@@ -2199,6 +2199,7 @@ define([
tableStylerColumns
:
(
elValue
.
get_CellBorders
().
get_InsideV
()
===
null
&&
elValue
.
get_CellSelect
()
==
true
)
?
1
:
2
,
tableProps
:
elValue
,
borderProps
:
me
.
borderAdvancedProps
,
sectionProps
:
me
.
api
.
asc_GetSectionProps
(),
handler
:
function
(
result
,
value
)
{
if
(
result
==
'
ok
'
)
{
if
(
me
.
api
)
{
...
...
apps/documenteditor/main/app/view/TableSettings.js
View file @
ee3e78fd
...
...
@@ -740,6 +740,7 @@ define([
tableStylerColumns
:
(
elValue
.
get_CellBorders
().
get_InsideV
()
===
null
&&
elValue
.
get_CellSelect
()
==
true
)
?
1
:
2
,
tableProps
:
elValue
,
borderProps
:
me
.
borderAdvancedProps
,
sectionProps
:
me
.
api
.
asc_GetSectionProps
(),
handler
:
function
(
result
,
value
)
{
if
(
result
==
'
ok
'
)
{
if
(
me
.
api
)
{
...
...
apps/documenteditor/main/app/view/TableSettingsAdvanced.js
View file @
ee3e78fd
...
...
@@ -91,6 +91,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this
.
tableStylerRows
=
this
.
options
.
tableStylerRows
;
this
.
tableStylerColumns
=
this
.
options
.
tableStylerColumns
;
this
.
borderProps
=
this
.
options
.
borderProps
;
this
.
pageWidth
=
(
this
.
options
.
sectionProps
)
?
this
.
options
.
sectionProps
.
get_W
()
-
this
.
options
.
sectionProps
.
get_LeftMargin
()
-
this
.
options
.
sectionProps
.
get_RightMargin
()
:
210
;
this
.
_originalProps
=
new
CTableProp
(
this
.
options
.
tableProps
);
},
...
...
@@ -114,9 +115,10 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this
.
chWidth
.
on
(
'
change
'
,
_
.
bind
(
function
(
field
,
newValue
,
oldValue
,
eOpts
){
var
value
=
(
newValue
==
'
checked
'
);
this
.
nfWidth
.
setDisabled
(
!
value
);
this
.
cmbUnit
.
setDisabled
(
!
value
);
if
(
this
.
_changedProps
)
{
if
(
value
&&
this
.
nfWidth
.
getNumberValue
()
>
0
)
this
.
_changedProps
.
put_Width
(
Common
.
Utils
.
Metric
.
fnRecalcToMM
(
this
.
nfWidth
.
getNumberValue
()));
this
.
_changedProps
.
put_Width
(
this
.
cmbUnit
.
getValue
()
?
-
field
.
getNumberValue
()
:
Common
.
Utils
.
Metric
.
fnRecalcToMM
(
this
.
nfWidth
.
getNumberValue
()));
else
this
.
_changedProps
.
put_Width
(
null
);
}
...
...
@@ -133,9 +135,30 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
});
this
.
nfWidth
.
on
(
'
change
'
,
_
.
bind
(
function
(
field
,
newValue
,
oldValue
,
eOpts
){
if
(
this
.
_changedProps
)
this
.
_changedProps
.
put_Width
(
Common
.
Utils
.
Metric
.
fnRecalcToMM
(
field
.
getNumberValue
()));
this
.
_changedProps
.
put_Width
(
this
.
cmbUnit
.
getValue
()
?
-
field
.
getNumberValue
()
:
Common
.
Utils
.
Metric
.
fnRecalcToMM
(
field
.
getNumberValue
()));
},
this
));
this
.
cmbUnit
=
new
Common
.
UI
.
ComboBox
({
el
:
$
(
'
#tableadv-cmb-unit
'
),
style
:
'
width: 85px;
'
,
menuStyle
:
'
min-width: 85px;
'
,
editable
:
false
,
cls
:
'
input-group-nr
'
,
data
:
[
{
value
:
0
,
displayValue
:
(
Common
.
Utils
.
Metric
.
getCurrentMetric
()
==
Common
.
Utils
.
Metric
.
c_MetricUnits
[
'
pt
'
])
?
this
.
txtPt
:
this
.
txtCm
},
{
value
:
1
,
displayValue
:
this
.
txtPercent
}
]
});
this
.
cmbUnit
.
on
(
'
selected
'
,
_
.
bind
(
function
(
combo
,
record
)
{
if
(
this
.
_changedProps
)
{
var
maxwidth
=
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
558
);
this
.
nfWidth
.
setDefaultUnit
(
record
.
value
?
'
%
'
:
Common
.
Utils
.
Metric
.
metricName
[
Common
.
Utils
.
Metric
.
getCurrentMetric
()]);
this
.
nfWidth
.
setMaxValue
(
record
.
value
?
parseFloat
(
100
*
maxwidth
/
this
.
pageWidth
).
toFixed
(
2
)
:
maxwidth
);
this
.
nfWidth
.
setStep
((
record
.
value
||
Common
.
Utils
.
Metric
.
getCurrentMetric
()
==
Common
.
Utils
.
Metric
.
c_MetricUnits
.
pt
)
?
1
:
0.1
);
this
.
nfWidth
.
setValue
((
record
.
value
)
?
100
*
this
.
nfWidth
.
getNumberValue
()
/
this
.
pageWidth
:
this
.
pageWidth
*
this
.
nfWidth
.
getNumberValue
()
/
100
);
this
.
_changedProps
.
put_Width
(
record
.
value
?
-
this
.
nfWidth
.
getNumberValue
()
:
Common
.
Utils
.
Metric
.
fnRecalcToMM
(
this
.
nfWidth
.
getNumberValue
()));
}
},
this
));
this
.
spinners
.
push
(
this
.
nfWidth
);
this
.
chAllowSpacing
=
new
Common
.
UI
.
CheckBox
({
el
:
$
(
'
#tableadv-checkbox-spacing
'
),
...
...
@@ -1047,11 +1070,20 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
var
value
;
// main props
var
TableWidth
=
props
.
get_Width
();
if
(
TableWidth
!==
null
)
{
this
.
nfWidth
.
setValue
(
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
TableWidth
),
true
);
}
this
.
cmbUnit
.
store
.
at
(
0
).
set
(
'
displayValue
'
,
(
Common
.
Utils
.
Metric
.
getCurrentMetric
()
==
Common
.
Utils
.
Metric
.
c_MetricUnits
[
'
pt
'
])
?
this
.
txtPt
:
this
.
txtCm
);
this
.
cmbUnit
.
setValue
(
TableWidth
<
0
?
1
:
0
);
this
.
nfWidth
.
setDefaultUnit
(
TableWidth
<
0
?
'
%
'
:
Common
.
Utils
.
Metric
.
metricName
[
Common
.
Utils
.
Metric
.
getCurrentMetric
()]);
if
(
TableWidth
<
0
)
//%
this
.
nfWidth
.
setMaxValue
(
parseFloat
(
100
*
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
558
)
/
this
.
pageWidth
).
toFixed
(
2
));
this
.
nfWidth
.
setStep
((
TableWidth
<
0
||
Common
.
Utils
.
Metric
.
getCurrentMetric
()
==
Common
.
Utils
.
Metric
.
c_MetricUnits
.
pt
)
?
1
:
0.1
);
if
(
TableWidth
!==
null
)
this
.
nfWidth
.
setValue
(
TableWidth
>
0
?
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
TableWidth
)
:
-
TableWidth
,
true
);
this
.
chWidth
.
setValue
(
TableWidth
!==
null
,
true
);
this
.
nfWidth
.
setDisabled
(
this
.
chWidth
.
getValue
()
!==
'
checked
'
);
value
=
(
this
.
chWidth
.
getValue
()
!==
'
checked
'
);
this
.
nfWidth
.
setDisabled
(
value
);
this
.
cmbUnit
.
setDisabled
(
value
);
var
TableSpacing
=
props
.
get_Spacing
();
if
(
TableSpacing
!==
null
)
{
...
...
@@ -1924,6 +1956,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
spinner
.
setStep
(
Common
.
Utils
.
Metric
.
getCurrentMetric
()
==
Common
.
Utils
.
Metric
.
c_MetricUnits
.
cm
?
0.1
:
1
);
}
}
if
(
this
.
pageWidth
)
this
.
pageWidth
=
Common
.
Utils
.
Metric
.
fnRecalcFromMM
(
this
.
pageWidth
);
},
updateThemeColors
:
function
()
{
...
...
@@ -2006,7 +2040,10 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
tipCellInner
:
'
Set Vertical and Horizontal Lines for Inner Cells Only
'
,
tipTableOuterCellInner
:
'
Set Outer Border and Vertical and Horizontal Lines for Inner Cells
'
,
tipCellOuter
:
'
Set Outer Borders for Inner Cells Only
'
,
tipTableOuterCellOuter
:
'
Set Table Outer Border and Outer Borders for Inner Cells
'
tipTableOuterCellOuter
:
'
Set Table Outer Border and Outer Borders for Inner Cells
'
,
txtPercent
:
'
Percent
'
,
txtCm
:
'
Centimeter
'
,
txtPt
:
'
Point
'
},
DE
.
Views
.
TableSettingsAdvanced
||
{}));
});
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