|
@@ -257,13 +257,7 @@ App.MainDashboardView = Em.View.extend({
|
|
|
var yarnWidgets = ['24', '25', '26', '27'];
|
|
|
|
|
|
// check if cur_value has mapReduce
|
|
|
- var curhasMapreduce = false;
|
|
|
- for (var j = 0; j <= visible.length -1; j++) {
|
|
|
- if (visible[j] == mapWidgets[0]) {
|
|
|
- curhasMapreduce = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ var curhasMapreduce = visible.contains ( mapWidgets[0]);
|
|
|
for (var j = 0; j <= hidden.length -1; j++) {
|
|
|
if ( !curhasMapreduce && hidden[j][0] == mapWidgets[0]) {
|
|
|
curhasMapreduce = true;
|
|
@@ -274,11 +268,7 @@ App.MainDashboardView = Em.View.extend({
|
|
|
if ( this.get('yarn_model') != null && curhasMapreduce) {
|
|
|
// Remove all Mapreduce widgets and add Yarn widgets as visible
|
|
|
mapWidgets.forEach ( function (item) {
|
|
|
- for (var j = 0; j <= visible.length -1; j++) {
|
|
|
- if (visible[j] == item) {
|
|
|
- visible.splice(j, 1);
|
|
|
- }
|
|
|
- }
|
|
|
+ visible = visible.without(item);
|
|
|
for (var j = 0; j <= hidden.length -1; j++) {
|
|
|
if (hidden[j][0] == item) {
|
|
|
hidden.splice(j, 1);
|