mirror of
https://github.com/Readarr/Readarr.git
synced 2026-03-31 18:35:32 -04:00
rjs -> webpack
This commit is contained in:
@@ -1,24 +1,16 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'vent',
|
||||
'AppLayout',
|
||||
'marionette'
|
||||
], function (vent, AppLayout, Marionette) {
|
||||
var vent = require('../../vent');
|
||||
var AppLayout = require('../../AppLayout');
|
||||
var Marionette = require('marionette');
|
||||
|
||||
return Marionette.AppRouter.extend({
|
||||
|
||||
initialize: function () {
|
||||
vent.on(vent.Commands.OpenControlPanelCommand, this._openControlPanel, this);
|
||||
vent.on(vent.Commands.CloseControlPanelCommand, this._closeControlPanel, this);
|
||||
},
|
||||
|
||||
_openControlPanel: function (view) {
|
||||
AppLayout.controlPanelRegion.show(view);
|
||||
},
|
||||
|
||||
_closeControlPanel: function () {
|
||||
AppLayout.controlPanelRegion.closePanel();
|
||||
}
|
||||
});
|
||||
});
|
||||
module.exports = Marionette.AppRouter.extend({
|
||||
initialize : function(){
|
||||
vent.on(vent.Commands.OpenControlPanelCommand, this._openControlPanel, this);
|
||||
vent.on(vent.Commands.CloseControlPanelCommand, this._closeControlPanel, this);
|
||||
},
|
||||
_openControlPanel : function(view){
|
||||
AppLayout.controlPanelRegion.show(view);
|
||||
},
|
||||
_closeControlPanel : function(){
|
||||
AppLayout.controlPanelRegion.closePanel();
|
||||
}
|
||||
});
|
||||
@@ -1,35 +1,39 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'backbone',
|
||||
'marionette'
|
||||
], function ($,Backbone, Marionette) {
|
||||
var region = Marionette.Region.extend({
|
||||
el: '#control-panel-region',
|
||||
var $ = require('jquery');
|
||||
var Backbone = require('backbone');
|
||||
var Marionette = require('marionette');
|
||||
|
||||
constructor: function () {
|
||||
Backbone.Marionette.Region.prototype.constructor.apply(this, arguments);
|
||||
this.on('show', this.showPanel, this);
|
||||
},
|
||||
|
||||
getEl: function (selector) {
|
||||
var $el = $(selector);
|
||||
|
||||
return $el;
|
||||
},
|
||||
|
||||
showPanel: function () {
|
||||
$('body').addClass('control-panel-visible');
|
||||
this.$el.animate({ 'margin-bottom': 0, 'opacity': 1 }, { queue: false, duration: 300 });
|
||||
},
|
||||
|
||||
closePanel: function () {
|
||||
$('body').removeClass('control-panel-visible');
|
||||
this.$el.animate({ 'margin-bottom': -100, 'opacity': 0 }, { queue: false, duration: 300 });
|
||||
this.reset();
|
||||
}
|
||||
});
|
||||
|
||||
return region;
|
||||
module.exports = (function(){
|
||||
var region = Marionette.Region.extend({
|
||||
el : '#control-panel-region',
|
||||
constructor : function(){
|
||||
Backbone.Marionette.Region.prototype.constructor.apply(this, arguments);
|
||||
this.on('show', this.showPanel, this);
|
||||
},
|
||||
getEl : function(selector){
|
||||
var $el = $(selector);
|
||||
return $el;
|
||||
},
|
||||
showPanel : function(){
|
||||
$('body').addClass('control-panel-visible');
|
||||
this.$el.animate({
|
||||
"margin-bottom" : 0,
|
||||
"opacity" : 1
|
||||
}, {
|
||||
queue : false,
|
||||
duration : 300
|
||||
});
|
||||
},
|
||||
closePanel : function(){
|
||||
$('body').removeClass('control-panel-visible');
|
||||
this.$el.animate({
|
||||
"margin-bottom" : -100,
|
||||
"opacity" : 0
|
||||
}, {
|
||||
queue : false,
|
||||
duration : 300
|
||||
});
|
||||
this.reset();
|
||||
}
|
||||
});
|
||||
return region;
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user