[DE] Compare documents: use sdk methods
This commit is contained in:
parent
8ae13a7fde
commit
322888f37d
|
@ -557,9 +557,13 @@ define([
|
||||||
|
|
||||||
onCompareClick: function(item) {
|
onCompareClick: function(item) {
|
||||||
if (this.api) {
|
if (this.api) {
|
||||||
|
if (!this._state.compareSettings) {
|
||||||
|
this._state.compareSettings = new AscCommonWord.ComparisonOptions();
|
||||||
|
this._state.compareSettings.putWords(!Common.localStorage.getBool("de-compare-char"));
|
||||||
|
}
|
||||||
if (item === 'file') {
|
if (item === 'file') {
|
||||||
// if (this.api)
|
if (this.api)
|
||||||
// this.api.asc_addDocument(me._state.compareSettings);
|
this.api.asc_CompareDocumentFile(this._state.compareSettings);
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||||
} else if (item === 'url') {
|
} else if (item === 'url') {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -570,7 +574,7 @@ define([
|
||||||
if (me.api) {
|
if (me.api) {
|
||||||
var checkUrl = value.replace(/ /g, '');
|
var checkUrl = value.replace(/ /g, '');
|
||||||
if (!_.isEmpty(checkUrl)) {
|
if (!_.isEmpty(checkUrl)) {
|
||||||
// me.api.AddDocumentUrl(checkUrl, me._state.compareSettings);
|
me.api.asc_CompareDocumentUrl(checkUrl, me._state.compareSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.view);
|
Common.NotificationCenter.trigger('edit:complete', me.view);
|
||||||
|
|
|
@ -107,8 +107,7 @@ define([
|
||||||
this.radioWord = new Common.UI.RadioBox({
|
this.radioWord = new Common.UI.RadioBox({
|
||||||
el: $('#compare-settings-radio-word'),
|
el: $('#compare-settings-radio-word'),
|
||||||
labelText: this.textWord,
|
labelText: this.textWord,
|
||||||
name: 'asc-radio-compare-show',
|
name: 'asc-radio-compare-show'
|
||||||
checked: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.afterRender();
|
this.afterRender();
|
||||||
|
@ -124,15 +123,15 @@ define([
|
||||||
|
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
if (props) {
|
if (props) {
|
||||||
// var val = props.get_ShowAt();
|
var value = props.getWords();
|
||||||
// val ? this.radioChar.setValue(true, true) : this.radioWord.setValue(true, true);
|
(value==false) ? this.radioChar.setValue(true, true) : this.radioWord.setValue(true, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getSettings: function () {
|
getSettings: function () {
|
||||||
// var props = new AscCommon.CComparisonPr();
|
var props = new AscCommonWord.ComparisonOptions();
|
||||||
// props.put_ShowAt(this.radioChar.getValue());
|
props.putWords(this.radioWord.getValue());
|
||||||
// return props;
|
return props;
|
||||||
},
|
},
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
onDlgBtnClick: function(event) {
|
||||||
|
@ -140,6 +139,7 @@ define([
|
||||||
var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
|
var state = (typeof(event) == 'object') ? event.currentTarget.attributes['result'].value : event;
|
||||||
if (state == 'ok') {
|
if (state == 'ok') {
|
||||||
this.handler && this.handler.call(this, state, this.getSettings());
|
this.handler && this.handler.call(this, state, this.getSettings());
|
||||||
|
Common.localStorage.setItem("de-compare-char", this.radioChar.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
|
|
Loading…
Reference in a new issue