Skip to content

Commit

Permalink
Merge pull request #35 from hadihakim/fix/WEB2-2487-title-navigate
Browse files Browse the repository at this point in the history
update plugin instance title to navigate to
  • Loading branch information
charkhaw authored Apr 28, 2023
2 parents 3fd0720 + 161e16d commit 17e3b19
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions control/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,14 @@


if (result && Object.keys(config.pluginData).length > 0) {
pluginInstanceName.innerHTML = config.pluginData.pluginTypeName + ': ' + config.pluginData.title;
queryStringContainer.style.display = "grid"
getPluginInstance(config.pluginData.instanceId).then(pluginInstance => {
if(pluginInstance && pluginInstance.title !== config.pluginData.title) {
config.pluginData.title = pluginInstance.title;
config.save();
}
pluginInstanceName.innerHTML = config.pluginData.pluginTypeName + ': ' + config.pluginData.title;
queryStringContainer.style.display = "grid"
});
} else {
pluginInstanceName.innerHTML = 'Social Wall'
queryStringContainer.style.display = "none"
Expand Down Expand Up @@ -412,6 +418,19 @@
})
}

function getPluginInstance (instanceId) {
return new Promise((resolve, reject) => {
if(!instanceId) resolve(null);
buildfire.pluginInstance.get(instanceId, function(error, instance) {
if (instance) {
resolve(instance);
} else {
resolve(null);
}
});
});
}

function setBothPrivacyElements() {
let elements = document.getElementsByClassName("tagInputContainer");
if (config.writePrivacy === Config.WRITE_PRIVACY.PRIVATE) {
Expand Down

0 comments on commit 17e3b19

Please sign in to comment.