cosmetic changes

This commit is contained in:
rolux 2013-07-14 18:56:47 +00:00
parent 56dfb277db
commit 1699cecff0

View file

@ -149,7 +149,7 @@ pandora.ui.textPanel = function() {
}) })
.bindEvent({ .bindEvent({
click: function(data) { click: function(data) {
if(data.files.length) { if (data.files.length) {
pandora.$ui.uploadPDFDialog = pandora.ui.uploadPDFDialog({ pandora.$ui.uploadPDFDialog = pandora.ui.uploadPDFDialog({
file: data.files[0], file: data.files[0],
id: pandora.user.ui.text id: pandora.user.ui.text
@ -339,7 +339,7 @@ pandora.ui.textPDF = function(text) {
width: '100%' width: '100%'
}) })
.onMessage(function(event, data) { .onMessage(function(event, data) {
if(event == 'edit') { if (event == 'edit') {
pandora.ui.insertEmbedDialog(data.src, function(url) { pandora.ui.insertEmbedDialog(data.src, function(url) {
data.src = url; data.src = url;
var embed = text.embeds.filter(function(embed) { var embed = text.embeds.filter(function(embed) {
@ -347,9 +347,8 @@ pandora.ui.textPDF = function(text) {
&& embed.type == data.type && embed.type == data.type
&& embed.page == data.page; && embed.page == data.page;
})[0]; })[0];
if(embed) { if (embed) {
embed.src = url; embed.src = url;
} else { } else {
text.embeds.push(data); text.embeds.push(data);
//fixme sort embeds by page/id //fixme sort embeds by page/id