[All] migrate to lodash

This commit is contained in:
Maxim Kadushkin 2018-07-20 15:28:23 +03:00
parent 4b42e4f524
commit ce28412450
19 changed files with 31 additions and 31 deletions

View file

@ -90,7 +90,7 @@ define([
isSuspendEvents: false,
initialize : function(options) {
this.options = this.options ? _({}).extend(this.options, options) : options;
this.options = this.options ? _.extend({}, this.options, options) : options;
},
setVisible: function(visible) {

View file

@ -459,7 +459,7 @@ define([
tip.dontShow = true;
(tip.tip()).remove();
}
}, this);
});
$(this.el).html(this.template({
groups: this.groups ? this.groups.toJSON() : null,
@ -477,10 +477,10 @@ define([
_.each(this.dataViewItems, function(item) {
this.stopListening(item);
item.stopListening(item.model);
}, this);
}.bind(this));
this.dataViewItems = [];
this.store.each(this.onAddItem, this);
this.store.each(this.onAddItem.bind(this));
if (this.allowScrollbar) {
this.scroller = new Common.UI.Scroller({

View file

@ -72,7 +72,7 @@
_.each(this.allocationMap, function(name, key) {
this[name] = this[name] || {};
}, this);
}.bind(this));
},
/**
@ -140,7 +140,7 @@
this.buildCollections();
this.controllers[ctrl] = controller;
}, this);
}.bind(this));
},
/**
@ -149,7 +149,7 @@
launchControllers: function() {
_.each(this.controllers, function(ctrl, id) {
ctrl.onLaunch(this);
}, this);
}.bind(this));
},
/**
@ -267,7 +267,7 @@
buildCollections: function() {
_.each(this.collections, function(collection, alias) {
this.getCollection(alias);
}, this);
}.bind(this));
}
});
@ -513,7 +513,7 @@
if(_.isArray(selectors)) {
_.each(selectors, function(selector) {
this.addListeners(selector, controller);
}, this)
}.bind(this))
}
else if(_.isObject(selectors)) {
_.each(selectors, function(listeners, selector) {
@ -522,8 +522,8 @@
pool[selector][event] = pool[selector][event] || [];
pool[selector][event].push(listener);
}, this);
}, this)
}.bind(this));
}.bind(this))
}
},
@ -547,7 +547,7 @@
}
}, this);
}.bind(this));
},
getApplication: function() {

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',

View file

@ -2057,7 +2057,7 @@ define([
var variationsArr = [],
pluginVisible = false;
item.variations.forEach(function(itemVar){
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'word');
var visible = (isEdit || itemVar.isViewer) && _.includes(itemVar.EditorsSupport, 'word');
if ( visible ) pluginVisible = true;
if (item.isUICustomizer ) {

View file

@ -353,7 +353,7 @@ define([
checked : this.langMenu.saved == item.title,
toggleGroup : 'language'
});
}, this);
}.bind(this));
this.langMenu.doLayout();
if (this.langMenu.items.length>0) {

View file

@ -2049,11 +2049,11 @@ define([
}
if (index == 21) {
this.mnuColorSchema.addItem({
me.mnuColorSchema.addItem({
caption: '--'
});
} else {
this.mnuColorSchema.addItem({
me.mnuColorSchema.addItem({
template: itemTemplate,
cls: 'color-schemas-menu',
colors: schemecolors,
@ -2061,7 +2061,7 @@ define([
value: index
});
}
}, this);
});
},
/** coauthoring begin **/

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',

View file

@ -1814,7 +1814,7 @@ define([
var variationsArr = [],
pluginVisible = false;
item.variations.forEach(function(itemVar){
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'slide');
var visible = (isEdit || itemVar.isViewer) && _.includes(itemVar.EditorsSupport, 'slide');
if ( visible ) pluginVisible = true;
if ( item.isUICustomizer ) {

View file

@ -343,7 +343,7 @@ define([
checked : this.langMenu.saved == item.title,
toggleGroup : 'language'
});
}, this);
}.bind(this));
this.langMenu.doLayout();
if (this.langMenu.items.length>0) {

View file

@ -823,7 +823,7 @@ define([
opts.merge && (controls = _.union(this.lockControls, controls));
function doLock(cmp, cause) {
if (_.contains(cmp.options.lock, cause)) {
if (_.includes(cmp.options.lock, cause)) {
var index = cmp.keepState.indexOf(cause);
if (lock) {
if (index < 0) {

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
xregexp : '../vendor/xregexp/xregexp-all-min',
sockjs : '../vendor/sockjs/sockjs.min',
allfonts : '../../sdkjs/common/AllFonts'

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',

View file

@ -2001,7 +2001,7 @@ define([
var variationsArr = [],
pluginVisible = false;
item.variations.forEach(function(itemVar){
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'cell');
var visible = (isEdit || itemVar.isViewer) && _.includes(itemVar.EditorsSupport, 'cell');
if ( visible ) pluginVisible = true;
if ( item.isUICustomizer ) {

View file

@ -175,7 +175,7 @@ define([
_btn.render( $('#'+item[2])) ;
_btn.on('click', _.bind(this.onBtnBordersClick, this));
this.lockedControls.push(_btn);
}, this);
}.bind(this));
this.cmbBorderType = new Common.UI.ComboBorderType({
el: $('#cell-combo-border-type'),

View file

@ -149,7 +149,7 @@ define([
opts.merge && (controls = _.union(this.lockControls,controls));
function doLock(cmp, cause) {
if ( cmp && _.contains(cmp.options.lock, cause) ) {
if ( cmp && _.includes(cmp.options.lock, cause) ) {
var index = cmp.keepState.indexOf(cause);
if (lock) {
if (index < 0) {
@ -1758,7 +1758,7 @@ define([
value : index
});
}
}, this);
}.bind(this));
},
onApiCollaborativeChanges: function() {

View file

@ -46,7 +46,7 @@ require.config({
baseUrl: '../../',
paths: {
jquery : '../vendor/jquery/jquery',
underscore : '../vendor/underscore/underscore',
underscore : '../vendor/lodash/lodash',
backbone : '../vendor/backbone/backbone',
bootstrap : '../vendor/bootstrap/dist/js/bootstrap',
text : '../vendor/requirejs-text/text',