// Generated by CoffeeScript 1.9.3

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

(function() {
  document.webL10n.ready(function() {
    var music_playlist, player;
    music_playlist = cs.music_playlist;
    player = document.querySelector('cs-music-player');
    return Polymer('cs-music-library-action', {
      create_playlist_text: _('create-playlist'),
      add_to_playlist_text: _('add-to-playlist'),
      items: [],
      update: function(items) {
        return this.items = items;
      },
      create_playlist: function() {
        return music_playlist.set(this.items, (function(_this) {
          return function() {
            return player.next(function() {
              return _this.go_to_screen('player');
            });
          };
        })(this));
      },
      add_to_playlist: function() {
        return music_playlist.append(this.items, (function(_this) {
          return function() {
            return _this.go_back_screen();
          };
        })(this));
      },
      back: function() {
        return this.go_back_screen();
      }
    });
  });

}).call(this);
