vendor/assets/javascripts/adapters/mootools.js in highcharts-js-rails-0.1.6 vs vendor/assets/javascripts/adapters/mootools.js in highcharts-js-rails-0.1.7

- old
+ new

@@ -1,7 +1,7 @@ /** - * @license Highcharts JS v2.2.3 (2012-05-07) + * @license Highcharts JS v2.2.4 (2012-05-31) * MooTools adapter * * (c) 2010-2011 Torstein Hønsi * * License: www.highcharts.com/license @@ -66,10 +66,23 @@ return morphCompute.apply(fx, arguments); } }; /*jslint unparam: false*/ }, + + /** + * Run a general method on the framework, following jQuery syntax + * @param {Object} el The HTML element + * @param {String} method Which method to run on the wrapped element + */ + adapterRun: function (el, method) { + + // This currently works for getting inner width and height. If adding + // more methods later, we need a conditional implementation for each. + return $(el).getStyle(method).toInt(); + + }, /** * Downloads a script and executes a callback when done. * @param {String} scriptLocation * @param {Function} callback @@ -242,18 +255,19 @@ removeEvent: function (el, type, fn) { if (typeof el === 'string') { // el.removeEvents below apperantly calls this method again. Do not quite understand why, so for now just bail out. return; } + win.HighchartsAdapter.extendWithEvents(el); if (type) { if (type === 'unload') { // Moo self destructs before custom unload events type = 'beforeunload'; } if (fn) { el.removeEvent(type, fn); - } else { + } else if (el.removeEvents) { // #958 el.removeEvents(type); } } else { el.removeEvents(); }