diff --git a/dashboard-ui/components/apphost.js b/dashboard-ui/components/apphost.js index 369646cf18..9d08eeada7 100644 --- a/dashboard-ui/components/apphost.js +++ b/dashboard-ui/components/apphost.js @@ -94,6 +94,8 @@ define(['appStorage', 'browser'], function (appStorage, browser) { 'filedownload' ]; + features.push('sharing'); + return features.indexOf(command.toLowerCase()) != -1; }, appInfo: function () { diff --git a/dashboard-ui/components/sharingwidget.js b/dashboard-ui/components/sharingwidget.js index c656413028..87f87d400a 100644 --- a/dashboard-ui/components/sharingwidget.js +++ b/dashboard-ui/components/sharingwidget.js @@ -1,4 +1,4 @@ -define(['dialogHelper', 'jQuery', 'thirdparty/social-share-kit-1.0.4/dist/js/social-share-kit.min', 'css!thirdparty/social-share-kit-1.0.4/dist/css/social-share-kit.css'], function (dialogHelper, $) { +define(['dialogHelper', 'thirdparty/social-share-kit-1.0.4/dist/js/social-share-kit.min', 'css!thirdparty/social-share-kit-1.0.4/dist/css/social-share-kit.css'], function (dialogHelper) { function showMenu(options, successCallback, cancelCallback) { @@ -58,11 +58,16 @@ } }); - // Has to be assigned a z-index after the call to .open() - $('.ssk', dlg).on('click', function () { + function onSskButtonClick(e) { isShared = true; dialogHelper.close(dlg); - }); + } + + // Has to be assigned a z-index after the call to .open() + var sskButtons = dlg.querySelectorAll('.ssk'); + for (var i = 0, length = sskButtons.length; i < length; i++) { + sskButtons[i].addEventListener('click', onSskButtonClick); + } // Has to be assigned a z-index after the call to .open() dlg.querySelector('.btnCancel').addEventListener('click', function () {