|
1 | 1 | /* Put everything inside the global mpl namespace */ |
| 2 | + |
| 3 | +// Universal Module Definition |
| 4 | +(function (root, factory) { |
| 5 | + if (typeof define === 'function' && define.amd) { |
| 6 | + // AMD |
| 7 | + define(['jquery'], factory); |
| 8 | + } else { |
| 9 | + // Browser globals (root is window) |
| 10 | + root.returnExports = factory(root.jQuery); |
| 11 | + } |
| 12 | +}(this, function ($) { |
| 13 | + |
2 | 14 | window.mpl = {}; |
3 | 15 |
|
4 | 16 |
|
@@ -133,11 +145,11 @@ mpl.figure.prototype._init_canvas = function() { |
133 | 145 | this.context = canvas[0].getContext("2d"); |
134 | 146 |
|
135 | 147 | var backingStore = this.context.backingStorePixelRatio || |
136 | | - this.context.webkitBackingStorePixelRatio || |
137 | | - this.context.mozBackingStorePixelRatio || |
138 | | - this.context.msBackingStorePixelRatio || |
139 | | - this.context.oBackingStorePixelRatio || |
140 | | - this.context.backingStorePixelRatio || 1; |
| 148 | + this.context.webkitBackingStorePixelRatio || |
| 149 | + this.context.mozBackingStorePixelRatio || |
| 150 | + this.context.msBackingStorePixelRatio || |
| 151 | + this.context.oBackingStorePixelRatio || |
| 152 | + this.context.backingStorePixelRatio || 1; |
141 | 153 |
|
142 | 154 | mpl.ratio = (window.devicePixelRatio || 1) / backingStore; |
143 | 155 |
|
@@ -552,3 +564,7 @@ mpl.figure.prototype.toolbar_button_onclick = function(name) { |
552 | 564 | mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) { |
553 | 565 | this.message.textContent = tooltip; |
554 | 566 | }; |
| 567 | + |
| 568 | +return mpl; |
| 569 | + |
| 570 | +})); |
0 commit comments