From 067c9b2aefa3920f9b42437a803c3e6732ef8818 Mon Sep 17 00:00:00 2001 From: Abhishek Sinha Date: Tue, 31 Dec 2019 14:06:44 +0530 Subject: [PATCH] modified change section names functionality for multiple articles in same object --- blockchainCloud_client.html | 40 +++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/blockchainCloud_client.html b/blockchainCloud_client.html index 6088e75..0921139 100644 --- a/blockchainCloud_client.html +++ b/blockchainCloud_client.html @@ -343,6 +343,7 @@
+
@@ -7729,26 +7730,37 @@ //section_settings if(!floGlobals.subAdmins.includes(myFloID)) return false; + const section_names_settings = document.getElementById('section_names_select_settings'); let section_settings_html = ''; - // Object.keys(floGlobals.appObjects[this.SUBJECT]).forEach(k=>{ - // section_settings_html += ``; - // }); - - const section_settings = document.getElementById('section_settings'); - let sec_counter = 1; - const Topic = Object.keys(floGlobals.appObjects[this.SUBJECT])[0]; - //const Topic = document.getElementById("topic_name_section").value; section_settings_html += `
Section Settings
`; + section_settings_html += ``; + + section_names_settings.innerHTML = section_settings_html; + + }, + + pop_up_section_names_ui: function() { + let sec_counter = 1; + let section_settings_html = ``; + const Topic = document.getElementById("topic_name_section").value; + const section_settings = document.getElementById("section_settings"); + + if(!Object.keys(floGlobals.appObjects[this.SUBJECT]).includes(Topic)) return; + section_settings.innerHTML=""; + section_settings_html += `
Section Names:
`; for(vals of Object.values(floGlobals.appObjects[this.SUBJECT][Topic].data)) { section_settings_html += ``; - section_settings_html += ``; + section_settings_html += ``; sec_counter++; } section_settings_html += ``; - section_settings.innerHTML = section_settings_html; + section_settings.innerHTML = section_settings_html; }, update_section_names: async function() { @@ -7762,14 +7774,12 @@ }); floCloudAPI.updateObjectData(floGlobals.appObjects[this.SUBJECT], full_data, this.SUBJECT, {receiverID: floGlobals.adminID}); + this.retrieveLatestContent(); }, retrieveLatestContent: async function(receiverID=floGlobals.adminID, senderIDs=floGlobals.subAdmins) { floCloudAPI.requestObjectData(this.SUBJECT,{receiverID, senderIDs}); floCloudAPI.requestGeneralData(this.CONTENT_TYPE); - // await this.delay(5000); - // document.getElementById('current_data').innerHTML = ''; - // this.showFullContentOfArticle(floGlobals.appObjects[this.SUBJECT]); }, createNewArticle: function(article_name, div='', number_of_sections=cloudArticleApp.numberOfSections) {