Skip to content

Commit

Permalink
Merge branch 'auxesisgh-92'
Browse files Browse the repository at this point in the history
  • Loading branch information
auxesis committed Mar 25, 2012
2 parents 3fc2858 + e863feb commit b73e9ee
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions lib/visage-app/public/javascripts/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,25 @@ var ChartBuilder = new Class({
show.addEvent('click', function(e) {
e.stop();

this.showGraphs();

// Fade the save button once graphs have been rendered.
this.save.fade.delay(1500, this.save, 'in')
this.profile_name.fade.delay(1500, this.profile_name, 'in')
var hosts = $(this.searchers.host).getElements("div.token.finalized"),
metrics = $(this.searchers.metric).getElements("div.token.finalized");

if (hosts.length > 0 && metrics.length > 0) {
this.showGraphs();
// Fade the save button once graphs have been rendered.
this.save.fade.delay(1500, this.save, 'in')
this.profile_name.fade.delay(1500, this.profile_name, 'in')
} else {
new Message({
title: 'Oops!',
message: 'You need to specify some hosts and metrics before you can show graphs.',
top: true,
iconPath: '/images/',
icon: 'caution.png',
}).say();
}

}.bind(this));

},
Expand Down

0 comments on commit b73e9ee

Please sign in to comment.