var MJ = MJ || {};

MJ.Views = MJ.Views || {};

/**
 * View for the search input
 *
 * @constructor
 */
MJ.Views.SearchInput = function (controller, elements) {
    this.controller = controller;
    this.rootNode = elements.rootNode;
    this.placeholder();
};

MJ.Views.SearchInput.prototype.placeholder = function () {
    if (!this.controller.placeholderSupport()) {
        this.rootNode.bind('focus', this.controller.viewFocused);
        this.rootNode.bind('blur', this.controller.viewBlurred);
        this.showPlaceholder();
    }
};

MJ.Views.SearchInput.prototype.showPlaceholder = function () {
    this.controller.viewBlurred();
    this.rootNode.val('Search SomeOne');
}
