// Generated by CoffeeScript 1.9.3

/**
 * @package   CleverStyle Music
 * @category  Web Components
 * @author    Nazar Mokrynskyi <nazar@mokrynskyi.com>
 * @copyright Copyright (c) 2015, Nazar Mokrynskyi
 * @license   MIT License, see license.txt
 */

(function() {
  Polymer({
    publish: {
      show: {
        value: false,
        reflect: true
      }
    },
    go_to_screen: function(screen, back) {
      var target;
      if (back == null) {
        back = false;
      }
      document.querySelector('[show]').setAttribute('show', false);
      target = document.querySelector('cs-music-' + screen);
      if (!back) {
        target.screen_from = this.get_screen_name();
      }
      return target.setAttribute('show', true);
    },
    go_back_screen: function() {
      return this.go_to_screen(this.screen_from, true);
    },
    get_screen_name: function() {
      return this.tagName.toLowerCase().substr(9);
    }
  });

}).call(this);
