diff --git a/app/assets/javascripts/spine/mobile/panel.js b/app/assets/javascripts/spine/mobile/panel.js new file mode 100644 index 0000000..c44067a --- /dev/null +++ b/app/assets/javascripts/spine/mobile/panel.js @@ -0,0 +1,132 @@ +(function() { + var $, Gfx, Panel, Stage; + var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { + for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor; + child.__super__ = parent.prototype; + return child; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + $ = Spine.$; + Gfx = require('gfx'); + Stage = require('./stage'); + Panel = (function() { + __extends(Panel, Stage); + Panel.prototype.title = false; + Panel.prototype.viewport = false; + function Panel() { + var _ref, _ref2; + Panel.__super__.constructor.apply(this, arguments); + this.el.removeClass('stage').addClass('panel'); + this.header.append($('

')); + if (this.title) { + this.setTitle(this.title); + } + if ((_ref = this.stage) == null) { + this.stage = Stage.globalStage(); + } + if ((_ref2 = this.stage) != null) { + _ref2.add(this); + } + } + Panel.prototype.setTitle = function(title) { + if (title == null) { + title = ''; + } + return this.header.find('h2:first').html(title); + }; + Panel.prototype.addButton = function(text, callback) { + var button; + if (typeof callback === 'string') { + callback = this[callback]; + } + button = $('