From ecee7fbb51339b8ea37419ca54f05ac527f79937 Mon Sep 17 00:00:00 2001 From: Jay Wood Date: Fri, 30 Sep 2016 11:21:15 -0400 Subject: [PATCH] Add cwv2Admin js file - #45 --- js/admin.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 js/admin.js diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 0000000..1b2803e --- /dev/null +++ b/js/admin.js @@ -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 ); \ No newline at end of file