Upstream version 11.40.271.0
[platform/framework/web/crosswalk.git] / src / ui / file_manager / gallery / js / error_banner.js
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6  * @param {Element} container Content container.
7  * @constructor
8  */
9 function ErrorBanner(container) {
10   this.container_ = container;
11   this.errorBanner_ = this.container_.querySelector('.error-banner');
12 }
13
14 /**
15  * Shows an error message.
16  * @param {string} message Message.
17  */
18 ErrorBanner.prototype.show = function(message) {
19   this.errorBanner_.textContent = str(message);
20   this.container_.setAttribute('error', true);
21 };
22
23 /**
24  * Hides an error message.
25  */
26 ErrorBanner.prototype.clear = function() {
27   this.container_.removeAttribute('error');
28 };