diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-22 20:32:58 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2012-12-22 20:32:58 +0100 |
commit | 6e0413b2e036b8fff997bcd1d6017681cdd91cfd (patch) | |
tree | 351eb28c2ab192785d19d4eb18166f42b9eae3d6 /module/web/static/js/views/headerView.js | |
parent | updated header, more responsive for smaller width (diff) | |
download | pyload-6e0413b2e036b8fff997bcd1d6017681cdd91cfd.tar.xz |
improved modal dialogs, added one for link grabber
Diffstat (limited to 'module/web/static/js/views/headerView.js')
-rw-r--r-- | module/web/static/js/views/headerView.js | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/module/web/static/js/views/headerView.js b/module/web/static/js/views/headerView.js index 6a4ac270d..9f7dda044 100644 --- a/module/web/static/js/views/headerView.js +++ b/module/web/static/js/views/headerView.js @@ -1,13 +1,16 @@ -define(['jquery', 'backbone', 'flot'], function($, Backbone){ +define(['jquery', 'backbone', 'flot'], function($, Backbone) { // Renders the header with all information return Backbone.View.extend({ el: 'header', events: { - + 'click .btn-grabber': 'open_grabber' }, + // Will hold the link grabber + grabber: null, + initialize: function() { var totalPoints = 100; @@ -38,21 +41,21 @@ define(['jquery', 'backbone', 'flot'], function($, Backbone){ var updateInterval = 1500; var speedgraph = $.plot(this.$el.find("#speedgraph"), [getRandomData()], { - series:{ - lines:{ show:true, lineWidth:2 }, - shadowSize:0, - color:"#fee247" + series: { + lines: { show: true, lineWidth: 2 }, + shadowSize: 0, + color: "#fee247" }, - xaxis:{ ticks:[], mode:"time" }, - yaxis:{ ticks:[], min:0, autoscaleMargin:0.1 }, - grid:{ - show:true, + xaxis: { ticks: [], mode: "time" }, + yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 }, + grid: { + show: true, // borderColor: "#757575", - borderColor:"white", - borderWidth:1, - labelMargin:0, - axisMargin:0, - minBorderMargin:0 + borderColor: "white", + borderWidth: 1, + labelMargin: 0, + axisMargin: 0, + minBorderMargin: 0 } }); @@ -68,8 +71,17 @@ define(['jquery', 'backbone', 'flot'], function($, Backbone){ }, - render: function() { + }, + + open_grabber: function() { + var self = this; + _.requireOnce(['views/linkGrabberModal'], function(modalView) { + if (self.grabber === null) + self.grabber = new modalView(); + + self.grabber.show(); + }); } }); });
\ No newline at end of file |