From d0c9848e898e77cb6e67f43abdd800e6c10f7474 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 23 Jan 2014 14:49:06 +0000 Subject: [PATCH] update embed grid --- static/js/embedGrid.js | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/static/js/embedGrid.js b/static/js/embedGrid.js index 1fea8466d..165f51c7b 100644 --- a/static/js/embedGrid.js +++ b/static/js/embedGrid.js @@ -57,12 +57,33 @@ pandora.ui.embedGrid = function() { }) .addClass('OxMedia') .bindEvent({ - open: function() { - window.open('/' + item + '', '_blank'); + init: function(data) { + $status.html( + (data.items ? Ox.formatNumber(data.items) : Ox._('No')) + + ' ' + pandora.site.itemName[ + data.items == 1 ? 'singular' : 'plural' + ] + ); + }, + open: function(data) { + window.open('/' + data.ids[0] + '', '_blank'); } }), - $statusbar = Ox.Bar({size: 16}), + $statusbar = Ox.Bar({size: 16}) + .css({ + textAlign: 'center' + }), + + $status = Ox.Element() + .css({ + margin: '2px 4px', + fontSize: '9px', + overflow: 'hidden', + textOverflow: 'ellipsis' + }) + .html(Ox._('Loading...')) + .appendTo($statusbar), that = Ox.SplitPanel({ elements: [