File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 8686 dialog_rating.close()
8787 }
8888 })
89+
90+ proposals.rateRead({{pk}})
91+
92+ const ratings = []
93+
94+ const eDiv_dialogContainer = document.querySelector('.dialog-container')
95+ const eP_question = eDiv_dialogContainer.querySelectorAll('p')
96+
97+ for(let elm of eP_question) {
98+ const eDiv_ratingWrapper = document.createElement('div')
99+ eDiv_ratingWrapper.classList = 'rating-wrapper'
100+ const eDiv_rating = document.createElement('div')
101+ eDiv_rating.classList = 'rating'
102+
103+ eDiv_ratingWrapper.appendChild(eDiv_rating)
104+
105+ for(let i=1; i<=5; i++) {
106+ const eSpan = document.createElement('span')
107+ eSpan.id = `star-${i}`
108+ eSpan.setAttribute('data-value', i)
109+ eSpan.classList = 'rating__star'
110+ eSpan.innerText = '⭐'
111+
112+ eSpan.onclick = function(e) {
113+ changeStar(e, elm)
114+ }
115+
116+ eDiv_rating.appendChild(eSpan)
117+ }
118+
119+ eDiv_dialogContainer.insertBefore(eDiv_ratingWrapper, elm.nextSibling)
120+ }
89121</script>
You can’t perform that action at this time.
0 commit comments