Created
September 20, 2011 20:10
-
-
Save anonymous/1230177 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ReportDesigner = Backbone.View.extend({ | |
| initialize: function(args) { | |
| this.workspace = args.workspace; | |
| // Create a unique ID for use as the CSS selector | |
| this.id = _.uniqueId("report_"); | |
| $(this.el).attr({ id: this.id }); | |
| this.add_button(); | |
| this.workspace.toolbar.report = this.show; | |
| [...] | |
| }, | |
| add_button: function() { | |
| var $chart_button = | |
| $('<a href="#report" class="report button disabled_toolbar i18n" title="Report Designer"></a>') | |
| .css({ 'background': | |
| "url('js/querybuilder/plugins/ReportDesigner/report.png') 50% 50% no-repeat" }); | |
| var $report_li = $('<li class="seperator"></li>').append($chart_button); | |
| $(this.workspace.toolbar.el).find("ul").append($report_li); | |
| }, | |
| [...] | |
| /** | |
| * init the reportdesigner plugin | |
| */ | |
| (function() { | |
| alert("hello reportdesigner"); | |
| function new_workspace(args) { | |
| args.workspace.report = new ReportDesigner({ workspace: args.workspace }); | |
| } | |
| for(var i = 0; i < Application.tabs._tabs.length; i++) { | |
| var tab = Application.tabs._tabs[i]; | |
| new_workspace({ | |
| workspace: tab.content | |
| }); | |
| }; | |
| Application.session.bind("workspace:new", new_workspace); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment