diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js index eed0cffadb..2e95b0c96b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbmediagrid.directive.js @@ -1,3 +1,87 @@ +/** +@ngdoc directive +@name umbraco.directives.directive:umbMediaGrid +@restrict E +@scope + +@description +Use this directive to generate a thumbnail grid of media items. + +
++ ++ +++ + +
+ (function () {
+ "use strict";
+
+ function Controller() {
+
+ var vm = this;
+ vm.mediaItems = [];
+
+ vm.clickItem = clickItem;
+ vm.clickItemName = clickItemName;
+
+ myService.getMediaItems().then(function (mediaItems) {
+ vm.mediaItems = mediaItems;
+ });
+
+ function clickItem(item, $event, $index){
+ // do magic here
+ }
+
+ function clickItemName(item, $event, $index) {
+ // set item.selected = true; to select the item
+ // do magic here
+ }
+
+ }
+
+ angular.module("umbraco").controller("My.Controller", Controller);
+ })();
+
+
+@param {array} items (binding): Array of media items.
+@param {callback=} onDetailsHover (binding): Callback method when the details icon is hovered.
+ item: The hovered item$event: The hover eventhover: Boolean to tell if the item is hovered or notbinding): Callback method to handle click events on the media item.
+ item: The clicked item$event: The click event$index: The item indexbinding): Callback method to handle click events on the media item name.
+ item: The clicked item$event: The click event$index: The item indexbinding): String to filter media items by
+@param {string=} itemMaxWidth (attribute): Sets a max width on the media item thumbnails.
+@param {string=} itemMaxHeight (attribute): Sets a max height on the media item thumbnails.
+@param {string=} itemMinWidth (attribute): Sets a min width on the media item thumbnails.
+@param {string=} itemMinHeight (attribute): Sets a min height on the media item thumbnails.
+
+**/
+
(function() {
'use strict';