[DE] devided ReviewChanges for private members
This commit is contained in:
parent
b0935bca7a
commit
d880555bbf
|
@ -409,15 +409,16 @@ define([
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend({
|
Common.Views.ReviewChanges = Common.UI.BaseView.extend(_.extend((function(){
|
||||||
el: '#review-changes-panel',
|
return {
|
||||||
|
el: '#review-changes-panel',
|
||||||
|
|
||||||
options: {},
|
options: {},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize: function (options) {
|
||||||
Common.UI.BaseView.prototype.initialize.call(this, options);
|
Common.UI.BaseView.prototype.initialize.call(this, options);
|
||||||
|
|
||||||
this.template = [
|
this.template = [
|
||||||
'<div class="review-group" style="">',
|
'<div class="review-group" style="">',
|
||||||
'<div id="id-review-button-prev" style=""></div>',
|
'<div id="id-review-button-prev" style=""></div>',
|
||||||
'<div id="id-review-button-next" style=""></div>',
|
'<div id="id-review-button-next" style=""></div>',
|
||||||
|
@ -431,134 +432,135 @@ define([
|
||||||
'<div class="review-group">',
|
'<div class="review-group">',
|
||||||
'<div id="id-review-button-close" style=""></div>',
|
'<div id="id-review-button-close" style=""></div>',
|
||||||
'</div>'
|
'</div>'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
this.store = this.options.store;
|
this.store = this.options.store;
|
||||||
this.popoverChanges = this.options.popoverChanges;
|
this.popoverChanges = this.options.popoverChanges;
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function () {
|
||||||
var el = $(this.el),
|
var el = $(this.el),
|
||||||
me = this;
|
me = this;
|
||||||
el.addClass('review-changes');
|
el.addClass('review-changes');
|
||||||
el.html(_.template(this.template, {
|
el.html(_.template(this.template, {
|
||||||
scope: this
|
scope: this
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.btnPrev = new Common.UI.Button({
|
this.btnPrev = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar',
|
cls: 'btn-toolbar',
|
||||||
iconCls: 'img-commonctrl review-prev',
|
iconCls: 'img-commonctrl review-prev',
|
||||||
value: 1,
|
value: 1,
|
||||||
hint: this.txtPrev,
|
hint: this.txtPrev,
|
||||||
hintAnchor: 'top'
|
hintAnchor: 'top'
|
||||||
});
|
|
||||||
this.btnPrev.render( $('#id-review-button-prev'));
|
|
||||||
|
|
||||||
this.btnNext = new Common.UI.Button({
|
|
||||||
cls: 'btn-toolbar',
|
|
||||||
iconCls: 'img-commonctrl review-next',
|
|
||||||
value: 2,
|
|
||||||
hint: this.txtNext,
|
|
||||||
hintAnchor: 'top'
|
|
||||||
});
|
|
||||||
this.btnNext.render( $('#id-review-button-next'));
|
|
||||||
|
|
||||||
this.btnAccept = new Common.UI.Button({
|
|
||||||
cls : 'btn-toolbar',
|
|
||||||
caption : this.txtAccept,
|
|
||||||
split : true,
|
|
||||||
menu : new Common.UI.Menu({
|
|
||||||
menuAlign: 'bl-tl',
|
|
||||||
style: 'margin-top:-5px;',
|
|
||||||
items: [
|
|
||||||
this.mnuAcceptCurrent = new Common.UI.MenuItem({
|
|
||||||
caption: this.txtAcceptCurrent,
|
|
||||||
value: 'current'
|
|
||||||
}),
|
|
||||||
this.mnuAcceptAll = new Common.UI.MenuItem({
|
|
||||||
caption: this.txtAcceptAll,
|
|
||||||
value: 'all'
|
|
||||||
})
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
this.btnAccept.render($('#id-review-button-accept'));
|
|
||||||
|
|
||||||
this.btnReject = new Common.UI.Button({
|
|
||||||
cls : 'btn-toolbar',
|
|
||||||
caption : this.txtReject,
|
|
||||||
split : true,
|
|
||||||
menu : new Common.UI.Menu({
|
|
||||||
menuAlign: 'bl-tl',
|
|
||||||
style: 'margin-top:-5px;',
|
|
||||||
items: [
|
|
||||||
this.mnuRejectCurrent = new Common.UI.MenuItem({
|
|
||||||
caption: this.txtRejectCurrent,
|
|
||||||
value: 'current'
|
|
||||||
}),
|
|
||||||
this.mnuRejectAll = new Common.UI.MenuItem({
|
|
||||||
caption: this.txtRejectAll,
|
|
||||||
value: 'all'
|
|
||||||
})
|
|
||||||
]
|
|
||||||
})
|
|
||||||
});
|
|
||||||
this.btnReject.render($('#id-review-button-reject'));
|
|
||||||
|
|
||||||
this.btnClose = new Common.UI.Button({
|
|
||||||
cls: 'btn-toolbar',
|
|
||||||
iconCls: 'img-commonctrl review-close',
|
|
||||||
hint: this.txtClose,
|
|
||||||
hintAnchor: 'top'
|
|
||||||
});
|
|
||||||
this.btnClose.render( $('#id-review-button-close'));
|
|
||||||
this.btnClose.on('click', _.bind(this.onClose, this));
|
|
||||||
|
|
||||||
this.boxSdk = $('#editor_sdk');
|
|
||||||
|
|
||||||
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
|
|
||||||
},
|
|
||||||
|
|
||||||
onClose: function(event) {
|
|
||||||
this.hide();
|
|
||||||
this.fireEvent('hide', this);
|
|
||||||
},
|
|
||||||
|
|
||||||
show: function () {
|
|
||||||
Common.UI.BaseView.prototype.show.call(this);
|
|
||||||
this.fireEvent('show', this);
|
|
||||||
},
|
|
||||||
|
|
||||||
onLayoutChanged: function(area) {
|
|
||||||
if (area=='rightmenu' && this.boxSdk) {
|
|
||||||
this.$el.css('right', ($('body').width() - this.boxSdk.offset().left - this.boxSdk.width() + 15) + 'px');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getPopover: function (sdkViewName) {
|
|
||||||
if (_.isUndefined(this.popover)) {
|
|
||||||
this.popover = new Common.Views.ReviewChangesPopover({
|
|
||||||
store : this.popoverChanges,
|
|
||||||
delegate : this,
|
|
||||||
renderTo : sdkViewName
|
|
||||||
});
|
});
|
||||||
}
|
this.btnPrev.render($('#id-review-button-prev'));
|
||||||
|
|
||||||
return this.popover;
|
this.btnNext = new Common.UI.Button({
|
||||||
},
|
cls: 'btn-toolbar',
|
||||||
|
iconCls: 'img-commonctrl review-next',
|
||||||
|
value: 2,
|
||||||
|
hint: this.txtNext,
|
||||||
|
hintAnchor: 'top'
|
||||||
|
});
|
||||||
|
this.btnNext.render($('#id-review-button-next'));
|
||||||
|
|
||||||
getUserName: function (username) {
|
this.btnAccept = new Common.UI.Button({
|
||||||
return Common.Utils.String.htmlEncode(username);
|
cls: 'btn-toolbar',
|
||||||
},
|
caption: this.txtAccept,
|
||||||
|
split: true,
|
||||||
|
menu: new Common.UI.Menu({
|
||||||
|
menuAlign: 'bl-tl',
|
||||||
|
style: 'margin-top:-5px;',
|
||||||
|
items: [
|
||||||
|
this.mnuAcceptCurrent = new Common.UI.MenuItem({
|
||||||
|
caption: this.txtAcceptCurrent,
|
||||||
|
value: 'current'
|
||||||
|
}),
|
||||||
|
this.mnuAcceptAll = new Common.UI.MenuItem({
|
||||||
|
caption: this.txtAcceptAll,
|
||||||
|
value: 'all'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
this.btnAccept.render($('#id-review-button-accept'));
|
||||||
|
|
||||||
txtPrev: 'To previous change',
|
this.btnReject = new Common.UI.Button({
|
||||||
txtNext: 'To next change',
|
cls: 'btn-toolbar',
|
||||||
txtAccept: 'Accept',
|
caption: this.txtReject,
|
||||||
txtAcceptCurrent: 'Accept current Changes',
|
split: true,
|
||||||
txtAcceptAll: 'Accept all Changes',
|
menu: new Common.UI.Menu({
|
||||||
txtReject: 'Reject',
|
menuAlign: 'bl-tl',
|
||||||
txtRejectCurrent: 'Reject current Changes',
|
style: 'margin-top:-5px;',
|
||||||
txtRejectAll: 'Reject all Changes',
|
items: [
|
||||||
txtClose: 'Close'
|
this.mnuRejectCurrent = new Common.UI.MenuItem({
|
||||||
}, Common.Views.ReviewChanges || {}))
|
caption: this.txtRejectCurrent,
|
||||||
|
value: 'current'
|
||||||
|
}),
|
||||||
|
this.mnuRejectAll = new Common.UI.MenuItem({
|
||||||
|
caption: this.txtRejectAll,
|
||||||
|
value: 'all'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
this.btnReject.render($('#id-review-button-reject'));
|
||||||
|
|
||||||
|
this.btnClose = new Common.UI.Button({
|
||||||
|
cls: 'btn-toolbar',
|
||||||
|
iconCls: 'img-commonctrl review-close',
|
||||||
|
hint: this.txtClose,
|
||||||
|
hintAnchor: 'top'
|
||||||
|
});
|
||||||
|
this.btnClose.render($('#id-review-button-close'));
|
||||||
|
this.btnClose.on('click', _.bind(this.onClose, this));
|
||||||
|
|
||||||
|
this.boxSdk = $('#editor_sdk');
|
||||||
|
|
||||||
|
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
|
||||||
|
},
|
||||||
|
|
||||||
|
onClose: function (event) {
|
||||||
|
this.hide();
|
||||||
|
this.fireEvent('hide', this);
|
||||||
|
},
|
||||||
|
|
||||||
|
show: function () {
|
||||||
|
Common.UI.BaseView.prototype.show.call(this);
|
||||||
|
this.fireEvent('show', this);
|
||||||
|
},
|
||||||
|
|
||||||
|
onLayoutChanged: function (area) {
|
||||||
|
if (area == 'rightmenu' && this.boxSdk) {
|
||||||
|
this.$el.css('right', ($('body').width() - this.boxSdk.offset().left - this.boxSdk.width() + 15) + 'px');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getPopover: function (sdkViewName) {
|
||||||
|
if (_.isUndefined(this.popover)) {
|
||||||
|
this.popover = new Common.Views.ReviewChangesPopover({
|
||||||
|
store: this.popoverChanges,
|
||||||
|
delegate: this,
|
||||||
|
renderTo: sdkViewName
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.popover;
|
||||||
|
},
|
||||||
|
|
||||||
|
getUserName: function (username) {
|
||||||
|
return Common.Utils.String.htmlEncode(username);
|
||||||
|
},
|
||||||
|
|
||||||
|
txtPrev: 'To previous change',
|
||||||
|
txtNext: 'To next change',
|
||||||
|
txtAccept: 'Accept',
|
||||||
|
txtAcceptCurrent: 'Accept current Changes',
|
||||||
|
txtAcceptAll: 'Accept all Changes',
|
||||||
|
txtReject: 'Reject',
|
||||||
|
txtRejectCurrent: 'Reject current Changes',
|
||||||
|
txtRejectAll: 'Reject all Changes',
|
||||||
|
txtClose: 'Close'
|
||||||
|
}
|
||||||
|
}()), Common.Views.ReviewChanges || {}))
|
||||||
});
|
});
|
Loading…
Reference in a new issue