insert supporter icon separately

pull/702/head
LukePulverenti 12 years ago
parent e8f5fade43
commit 528e7c8ba8

@ -648,12 +648,6 @@ var Dashboard = {
}).done(function (result) { }).done(function (result) {
deferred.resolveWith(null, [[result]]); deferred.resolveWith(null, [[result]]);
}).fail(function () {
console.log('Error getting plugin security info');
deferred.resolveWith(null, [[{ IsMBSupporter: false }]]);
}); });
Dashboard.getPluginSecurityInfoPromise = deferred; Dashboard.getPluginSecurityInfoPromise = deferred;
@ -674,12 +668,8 @@ var Dashboard = {
if (isLoggedIn) { if (isLoggedIn) {
var promise1 = Dashboard.getCurrentUser(); Dashboard.getCurrentUser().done(function (user) {
var promise2 = Dashboard.getPluginSecurityInfo(); Dashboard.renderHeader(page, user);
$.when(promise1, promise2).done(function (response1, response2) {
Dashboard.renderHeader(page, response1[0], response2[0]);
}); });
} else { } else {
@ -689,7 +679,7 @@ var Dashboard = {
} }
}, },
renderHeader: function (page, user, pluginSecurityInfo) { renderHeader: function (page, user) {
var headerHtml = ''; var headerHtml = '';
headerHtml += '<div class="header">'; headerHtml += '<div class="header">';
@ -728,11 +718,8 @@ var Dashboard = {
} }
headerHtml += '</a>'; headerHtml += '</a>';
if (pluginSecurityInfo.IsMBSupporter) {
headerHtml += '<a class="imageLink" href="supporter.html"><img src="css/images/suppbadge.png" /></a>';
}
if (user.Configuration.IsAdministrator) { if (user.Configuration.IsAdministrator) {
headerHtml += '<a class="imageLink" href="dashboard.html"><img src="css/images/tools' + imageColor + '.png" /></a>'; headerHtml += '<a class="imageLink btnTools" href="dashboard.html"><img src="css/images/tools' + imageColor + '.png" /></a>';
} }
headerHtml += '</div>'; headerHtml += '</div>';
@ -740,6 +727,12 @@ var Dashboard = {
headerHtml += '</div>'; headerHtml += '</div>';
page.prepend(headerHtml); page.prepend(headerHtml);
Dashboard.getPluginSecurityInfo().done(function (pluginSecurityInfo) {
if (pluginSecurityInfo.IsMBSupporter) {
$('<a class="imageLink" href="supporter.html"><img src="css/images/suppbadge.png" /></a>').insertBefore('.btnTools', page);
}
});
}, },
ensureToolsMenu: function (page) { ensureToolsMenu: function (page) {

@ -253,4 +253,7 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
EndGlobal EndGlobal

Loading…
Cancel
Save