/*! grafana - v4.5.1 - 2017-09-19
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["app/core/store","app/core/core_module"],function(a,b){"use strict";function c(){return{restrict:"E",controller:h,bindToController:!0,controllerAs:"ctrl",scope:{},template:g}}function d(a){return{restrict:"A",scope:{},link:function(b,c){var d=e.default.get("grafana.list.layout.mode")||"grid",f="card-list-layout-"+d;c.addClass(f),a.onAppEvent("layout-mode-changed",function(a,b){c.removeClass(f),f="card-list-layout-"+b,c.addClass(f)},b)}}}d.$inject=["$rootScope"];b&&b.id;a("layoutSelector",c),a("layoutMode",d);var e,f,g,h;return{setters:[function(a){e=a},function(a){f=a}],execute:function(){g='\n<div class="layout-selector">\n  <button ng-click="ctrl.listView()" ng-class="{active: ctrl.mode === \'list\'}">\n    <i class="fa fa-list"></i>\n  </button>\n  <button ng-click="ctrl.gridView()" ng-class="{active: ctrl.mode === \'grid\'}">\n    <i class="fa fa-th"></i>\n  </button>\n</div>\n',h=function(){function a(a){this.$rootScope=a,this.mode=e.default.get("grafana.list.layout.mode")||"grid"}return a.$inject=["$rootScope"],a.prototype.listView=function(){this.mode="list",e.default.set("grafana.list.layout.mode","list"),this.$rootScope.appEvent("layout-mode-changed","list")},a.prototype.gridView=function(){this.mode="grid",e.default.set("grafana.list.layout.mode","grid"),this.$rootScope.appEvent("layout-mode-changed","grid")},a}(),a("LayoutSelectorCtrl",h),f.default.directive("layoutSelector",c),f.default.directive("layoutMode",d)}}});