/// class PD.Web.UI.Controls.GridColumnNoResizeModule
/// using PD.Web.UI.Controls.GridModule

PD.Web.UI.Controls.GridColumnNoResizeModule =
PD.Web.UI.Controls.GridModule.extend({

    //===================================
    // FIELDS
    //===================================

    _index: null,
    _$header: null,

    //===================================
    // PUBLIC METHODS
    //===================================

    start: function () {
        this._$header = this.get_kendo().element.find(".k-grid-header");
        this._$header.on("mouseover", ".k-header", $.proxy(this._header_onMouseOver, this));
        this._$header.on("mouseover", ".k-resize-handle", $.proxy(this._handle_onMouseOver, this));
    },

    //===================================
    // EVENT HANDLERS
    //===================================

    _header_onMouseOver: function (e) {

        var $header = $(e.currentTarget),
            $resize = this._$header.find(".k-resize-handle");

        this._index = $header.data("index");

        if ($header.hasClass("-pd-noresize")) {
            $resize.css({
                cursor: "default",
                visibility: "hidden"
            });
        }
        else {
            $resize.css({
                cursor: "col-resize",
                visibility: "visible"
            });
        }

    },

    _handle_onMouseOver: function (e) {

        var $resize = $(e.currentTarget),
            $header = this._$header.find(".k-header[data-index=" + this._index + "]");

        if ($header.hasClass("-pd-noresize")) {
            $resize.css({
                cursor: "default",
                visibility: "hidden"
            });
        }
        else {
            $resize.css({
                cursor: "col-resize",
                visibility: "visible"
            });
        }

    }

});