Add cwv2Admin js file - #45
This commit is contained in:
40
js/admin.js
Normal file
40
js/admin.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
window.cwv2Admin = {};
|
||||||
|
( function( window, $, app ) {
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
app.init = function() {
|
||||||
|
app.cache();
|
||||||
|
|
||||||
|
if ( app.meetsRequirements() ) {
|
||||||
|
app.bindEvents();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Cache all the things
|
||||||
|
app.cache = function() {
|
||||||
|
app.$c = {
|
||||||
|
window: $(window),
|
||||||
|
// fooSelector: $( '.foo' ),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Combine all events
|
||||||
|
app.bindEvents = function() {
|
||||||
|
// app.$c.window.on( 'load', app.doFoo );
|
||||||
|
};
|
||||||
|
|
||||||
|
// Do we meet the requirements?
|
||||||
|
app.meetsRequirements = function() {
|
||||||
|
// Basically check
|
||||||
|
// return app.$c.fooSelector.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Some function
|
||||||
|
// app.doFoo = function() {
|
||||||
|
// do stuff
|
||||||
|
// };
|
||||||
|
|
||||||
|
// Engage
|
||||||
|
$( app.init );
|
||||||
|
|
||||||
|
})( window, jQuery, window.cwv2Admin );
|
Reference in New Issue
Block a user