PHP Classes
elePHPant
Icontem

File: src/Cabin/Bridge/public/pages_move.js

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  CMS Airship  >  src/Cabin/Bridge/public/pages_move.js  >  Download  
File: src/Cabin/Bridge/public/pages_move.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CMS Airship
Content management system with security features
Author: By
Last change: Merge remote-tracking branch 'origin/master'
Date: 9 months ago
Size: 1,334 bytes
 

Contents

Class file image Download
$(document).ready(function() {
    var dir_el = $("#directory");

    if ($.browser.webkit) {
        // Work around webkit being terrible and not letting us style <option> tags:
        dir_el.children("option").each(function () {
            var val = $(this).val();
            if (val !== parseInt(val, 10)) {
                $(this).html("-- " + Airship.e(val) + " --");
            } else {
                $(this).html($(this).data('fullpath'));
            }
        });
    }

    dir_el.on('change', function(e) {
        var cabin = $(this).parents("form").data('currentcabin');
        var chk_el = $("#create_redirect");
        var chk = '0';

        if ($("option:selected", this).data('cabin') !== cabin) {
            // We're forcing this to be unchecked.
            if (chk_el.is(":checked")) {
                chk = '1';
            }
            $("#create_redirect_row")
                .data("checked", chk)
                .hide(200);
            chk_el.prop('checked', false);
        } else {
            var row_el = $("#create_redirect_row");
            chk_el.prop(
                'checked',
                row_el.data("checked") === '1'
            );
            row_el.show(200);
        }
    });

    $("#cancel_btn").click(function() {
        window.location=$(this).data('href');
    });
});