replacing old .each mootools' method by _.each
This commit is contained in:
@@ -64,7 +64,7 @@ mindplot.widget.ColorPalettePanel = new Class({
|
||||
// Register on toolbar elements ...
|
||||
var colorCells = content.find('div[class=palette-colorswatch]');
|
||||
var model = this.getModel();
|
||||
colorCells.each(function (elem) {
|
||||
_.each(colorCells, function (elem) {
|
||||
$(elem).on('click', function () {
|
||||
var color = elem.css("background-color");
|
||||
model.setValue(color);
|
||||
@@ -80,7 +80,7 @@ mindplot.widget.ColorPalettePanel = new Class({
|
||||
|
||||
// Clear selected cell based on the color ...
|
||||
var tdCells = panelElem.find("td[class='palette-cell palette-cell-selected']");
|
||||
tdCells.each(function (elem) {
|
||||
_.each(tdCells, function (elem) {
|
||||
elem.className = 'palette-cell';
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ mindplot.widget.ColorPalettePanel = new Class({
|
||||
var colorCells = panelElem.find('div[class=palette-colorswatch]');
|
||||
var model = this.getModel();
|
||||
var modelValue = model.getValue();
|
||||
colorCells.each(function (elem) {
|
||||
_.each(colorCells, function (elem) {
|
||||
var color = elem.css("background-color");
|
||||
if (modelValue != null && modelValue[0] == 'r') {
|
||||
modelValue = modelValue.rgbToHex();
|
||||
|
@@ -35,7 +35,7 @@ mindplot.widget.IMenu = new Class({
|
||||
},
|
||||
|
||||
clear:function () {
|
||||
this._toolbarElems.each(function (item) {
|
||||
_.each(this._toolbarElems, function (item) {
|
||||
item.hide();
|
||||
});
|
||||
},
|
||||
|
@@ -37,7 +37,7 @@ mindplot.widget.ListToolbarPanel = new Class({
|
||||
var panelElem = this.getPanelElem();
|
||||
var menuElems = panelElem.getElements('div');
|
||||
var value = this.getModel().getValue();
|
||||
menuElems.each(function (elem) {
|
||||
_.each(menuElems, function (elem) {
|
||||
var elemValue = $defined(elem.getAttribute('model')) ? elem.getAttribute('model') : elem.id;
|
||||
$assert(elemValue, "elemValue can not be null");
|
||||
if (elemValue == value)
|
||||
|
@@ -452,7 +452,7 @@ mindplot.widget.Menu = new Class({
|
||||
_registerEvents: function (designer) {
|
||||
|
||||
// Register on close events ...
|
||||
this._toolbarElems.each(function (elem) {
|
||||
_.each(this._toolbarElems, function (elem) {
|
||||
elem.addEvent('show', function () {
|
||||
this.clear()
|
||||
}.bind(this));
|
||||
@@ -462,7 +462,7 @@ mindplot.widget.Menu = new Class({
|
||||
var topics = designer.getModel().filterSelectedTopics();
|
||||
var rels = designer.getModel().filterSelectedRelationships();
|
||||
|
||||
this._toolbarElems.each(function (button) {
|
||||
_.each(this._toolbarElems, function (button) {
|
||||
var isTopicAction = button.isTopicAction();
|
||||
var isRelAction = button.isRelAction();
|
||||
|
||||
@@ -480,7 +480,7 @@ mindplot.widget.Menu = new Class({
|
||||
var topics = designer.getModel().filterSelectedTopics();
|
||||
var rels = designer.getModel().filterSelectedRelationships();
|
||||
|
||||
this._toolbarElems.each(function (button) {
|
||||
_.each(this._toolbarElems, function (button) {
|
||||
var isTopicAction = button.isTopicAction();
|
||||
var isRelAction = button.isRelAction();
|
||||
|
||||
|
Reference in New Issue
Block a user