Show More
@@ -9,9 +9,34 | |||
|
9 | 9 | // MenuBar |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | /** | |
|
13 | * @module IPython | |
|
14 | * @namespace IPython | |
|
15 | * @submodule MenuBar | |
|
16 | */ | |
|
17 | ||
|
18 | ||
|
12 | 19 | var IPython = (function (IPython) { |
|
13 | 20 | |
|
14 | var MenuBar = function (selector) { | |
|
21 | /** | |
|
22 | * A MenuBar Class to generate the menubar of IPython noteboko | |
|
23 | * @Class MenuBar | |
|
24 | * | |
|
25 | * @constructor | |
|
26 | * | |
|
27 | * | |
|
28 | * @param selector {string} selector for the menubar element in DOM | |
|
29 | * @param {object} [options] | |
|
30 | * @param [options.baseProjectUrl] {String} String to use for the | |
|
31 | * Base Project url, default would be to inspect | |
|
32 | * $('body').data('baseProjectUrl'); | |
|
33 | * does not support change for now is set through this option | |
|
34 | */ | |
|
35 | var MenuBar = function (selector, options) { | |
|
36 | var options = options || {}; | |
|
37 | if(options.baseProjectUrl!= undefined){ | |
|
38 | this._baseProjectUrl = options.baseProjectUrl; | |
|
39 | } | |
|
15 | 40 | this.selector = selector; |
|
16 | 41 | if (this.selector !== undefined) { |
|
17 | 42 | this.element = $(selector); |
@@ -21,7 +46,7 var IPython = (function (IPython) { | |||
|
21 | 46 | }; |
|
22 | 47 | |
|
23 | 48 | MenuBar.prototype.baseProjectUrl = function(){ |
|
24 | return $('body').data('baseProjectUrl'); | |
|
49 | return this._baseProjectUrl || $('body').data('baseProjectUrl'); | |
|
25 | 50 | } |
|
26 | 51 | |
|
27 | 52 |
General Comments 0
You need to be logged in to leave comments.
Login now