/// class ProspectDirector.Web.UI.Queries.FiltersEditorDialog
/// using ProspectDirector.Web.UI.Dialog

/**
@class FiltersEditorDialog
@namespace Web.UI.Queries
@constructor
**/
ProspectDirector.Web.UI.Queries.FiltersEditorDialog = ProspectDirector.Web.UI.Dialog.extend({

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

    _editor: null,

    //================================
    // CONSTRUCTOR
    //================================

    init: function (options) {

        this.options = $.extend(true, {}, options, {
            config: {
                modal: true,
                content: Jade.Path.resolve("~/areas/hub/assets/internal/Web.UI.Queries/FiltersEditor/FiltersEditorDialog.htm"),
                iframe: false,
                resizable: false
            }
        });

        this._super(this.options);

    },

    //================================
    // PROPERTIES
    //================================

    get_options: function () {
        return this.options;
    },

    get_data: function () {
        return this.get_options().data;
    },

    get_okButton: function () {
        return this.get_container().find("INPUT[type=button][value=OK]");
    },

    get_cancelButton: function () {
        return this.get_container().find("INPUT[type=button][value=Cancel]");
    },

    //================================
    // INITIALIZERS
    //================================

    _init_dialog: function () {
        this.get_okButton().on("click", $.proxy(this._okButton_onClick, this));
        this.get_cancelButton().on("click", $.proxy(this._cancelButton_onClick, this));
    },

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

    _okButton_onClick: function (e) {
        this.hide();
    },

    _cancelButton_onClick: function (e) {
        this.hide();
    }

});

//================================
// STATIC METHODS
//================================

/**
@method open
@static
@return {Web.UI.Queries.FiltersEditorDialog}
**/
ProspectDirector.Web.UI.Queries.FiltersEditorDialog.open = function (options) {
    return new ProspectDirector.Web.UI.Queries.FiltersEditorDialog(options);
};
