/**
 * Created with RubyMine.
 * User: i061485
 * Date: 2/23/14
 * Time: 11:03 AM
 */

define([
    'plugins/plugin'
], function defineGalleryController(PluginBase) {

    /**
     * Define gallery controller
     * @class Controller
     * @mixin {BaseController}
     * @constructor
     */
    var Controller = function Controller() {
    };

    return Controller.extend({

        /**
         * Check if opened
         * @returns {boolean|*}
         */
        isOpened: function isOpened() {
            return this.scope.opened;
        },

        /**
         * Update opened
         * @param {Boolean} opened
         */
        setBehavior: function setBehavior(opened) {

            /**
             * Update opened instance
             */
            this.scope.opened = !!opened;
        },

        /**
         * Get providers data
         */
        getData: function getData() {
            return this.model.getProvidersList();
        },

        /**
         * Check if providers data was existing
         * @returns {boolean}
         */
        isDataExist: function isDataExist() {

            return anthill.base.lib.hash.isHashEmpty(
                this.scope.view.content
            );
        },

        /**
         * Load gallery content
         * @param opened
         */
        loadContent: function loadContent(opened) {

            if (opened && this.controller.isDataExist()) {
                this.view.renderContent(
                    this.controller.getData()
                );
            }
        }

    }, PluginBase.prototype);
});
@@ -1071,24 +1071,27 @@
       isData
+Not
 Exist: funct
@@ -1096,24 +1096,27 @@
 ction isData
+Not
 Exist() %7B%0A%0A 
@@ -1200,16 +1200,25 @@
 pe.view.
+elements.
 content%0A
@@ -1426,16 +1426,19 @@
 r.isData
+Not
 Exist())

fix loading content