Sha256: 0e0073602c26e9137ef52596aaa7badd9b532a1710d4a6f9900174e3c84214c6

Contents?: true

Size: 732 Bytes

Versions: 11

Compression:

Stored size: 732 Bytes

Contents

// initialize your global object will all your model names
var C80_PUSH = {

};

jQuery(document).ready(function ($) {
    // get the page action
    var action, model, b = $("body");
    if (b.hasClass("edit")) {
        action = "edit";
    } else if (b.hasClass("view")) {
        action = "view";
    } else if (b.hasClass("index")) {
        action = "index"
    } else if (b.hasClass("new")) {
        action = "new"
    }

    // run the code specific to a model and an action
    for (var m in C80_PUSH) {
        if (b.hasClass("admin_" + m)) {
            if (C80_PUSH[m][action] && typeof C80_PUSH[m][action] == "function") {
                C80_PUSH[m][action]();
                break;
            }
        }
    }
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
c80_push-0.1.0.11 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.10 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.8 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.7 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.6 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.5 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.4 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.3 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.2 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0.1 app/assets/javascripts/c80_push/lib_backend/init.js
c80_push-0.1.0 app/assets/javascripts/lib_backend/init.js