Skip to content

Commit

Permalink
Display a nag and prevent save if no triggers defined
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
shadyvb committed Jan 30, 2014
1 parent 70e101c commit 63b40a1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,15 @@ jQuery(function($){
// Do not submit if no triggers exist
$('#rule-form').submit(function(e){
if ( divTriggers.find('.trigger').size() < 1 ) {
$('body,html').scrollTop(0)
$('.wrap > h2')
.after('<div class="updated fade"><p>'+stream_notifications.i18n.empty_triggers+'</p></div>')
.after('<div class="updated error fade" style="display:none"><p>'+stream_notifications.i18n.empty_triggers+'</p></div>')
.next('.updated')
.slideDown('fast')
.delay(3000)
.fadeOut('slow');
$('body,html').scrollTop(0)
.slideUp('slow');
return false;
}
})
});

});

0 comments on commit 63b40a1

Please sign in to comment.