(function ($, document, window, FileReader, escape) { var currentItem; function getBaseRemoteOptions() { var options = {}; options.itemId = currentItem.Id; return options; } function reload(page, item) { Dashboard.showLoadingMsg(); if (item) { reloadItem(page, item); } else { ApiClient.getItem(Dashboard.getCurrentUserId(), currentItem.Id).done(function (item) { reloadItem(page, item); }); } } function reloadItem(page, item) { currentItem = item; } function initEditor(page) { } function showEditor(itemId) { Dashboard.showLoadingMsg(); ApiClient.ajax({ type: 'GET', url: 'components/metadataeditor/metadataeditor.template.html' }).done(function (template) { ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) { var dlg = document.createElement('paper-dialog'); dlg.setAttribute('with-backdrop', 'with-backdrop'); dlg.setAttribute('role', 'alertdialog'); // without this safari will scroll the background instead of the dialog contents dlg.setAttribute('modal', 'modal'); // seeing max call stack size exceeded in the debugger with this dlg.setAttribute('noAutoFocus', 'noAutoFocus'); dlg.entryAnimation = 'scale-up-animation'; dlg.exitAnimation = 'fade-out-animation'; dlg.classList.add('fullscreen-editor-paper-dialog'); dlg.classList.add('ui-body-b'); dlg.classList.add('smoothScrollY'); var html = ''; html += '