{:uriI"file:///Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts/push_type/fields/asset_field.js.coffee?type=application/javascript&pipeline=self&id=43f647a50b69b8c07736931a9d1aaa71bbccd9f0ab64f49b0b99c2bb5ec0a3fc:ET:load_pathI"E/Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts;T: filenameI"l/Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts/push_type/fields/asset_field.js.coffee;T: nameI"!push_type/fields/asset_field;T:logical_pathI")push_type/fields/asset_field.self.js;T:content_typeI"application/javascript;T: sourceI"(function() { this.app.controller('AssetFieldCtrl', [ '$scope', '$http', function($scope, $http) { $scope.$modal = null; $scope.assets = []; $scope.meta = {}; $scope.loadAssets = function(page) { var config, req; config = page != null ? { params: { page: page } } : null; req = $http.get($scope.assetsPath, config); return req.success(function(data) { $scope.assets = data.assets; $scope.meta = data.meta; if ($scope.hasAssets()) { return $scope.initPagination(); } }); }; $scope.hasAssets = function() { return $scope.assets.length; }; $scope.selectAsset = function(asset) { $scope.asset = asset; $scope.$modal.foundation('reveal', 'close'); return true; }; $scope.deselectAsset = function() { return $scope.asset = null; }; return $scope.afterUpload = function(asset) { $scope.loadAssets(); $scope.$modal.find('.tab-title a[data-success]').trigger('click'); return true; }; } ]); this.app.directive('paginateAssets', function() { return function($scope, $el, $attrs) { return $scope.initPagination = function() { return $el.pagination({ pages: $scope.meta.total_pages, currentPage: $scope.meta.current_page, hrefTextPrefix: '#/media/page-', onPageClick: function(page, e) { e.preventDefault(); return $scope.loadAssets(page); } }); }; }; }); $(document).on('ready page:load', function() { return $(document).on('open.fndtn.reveal', '.asset-field-modal', function() { var $scope; $scope = angular.element($(this)).scope(); $scope.$modal = $(this); $scope.loadAssets(); return $scope.$apply(); }); }); }).call(this); ;T: metadata{ :dependencieso:Set: @hash{ I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"zfile-digest:///Users/aaron/dev/pushcode/push_type/admin/app/assets/javascripts/push_type/fields/asset_field.js.coffee;TT: requiredo;;{: stubbedo;;{: linkso;;{: charsetI" utf-8;F: digest"%zfF&ca^J77pK: lengthi:dependencies_digest"%;lYꁛZaV6!)|:idI"E43f647a50b69b8c07736931a9d1aaa71bbccd9f0ab64f49b0b99c2bb5ec0a3fc;F: mtimel+?U