User:DannyS712/EFFPRH/sandbox.js: Difference between revisions

Content deleted Content added
links that log to console
try to actual launch a vue display
Line 27:
return;
}
// Add a hidden div after the headline that will be where the Vue
// display goes
$( this ).parent().after(
$( '<div>' ).attr( 'id', 'script-EFFPRH-' + sectionNum )
);
const reporterName = $( this ).text();
EFFPRH.addReportHandler( $editSectionLinks, reporterName, sectionNum );
Line 58 ⟶ 63:
function () {
console.log( 'Should launch for: ', reporterName, sectionNum );
EFFPRH.showReporter( reporterName, sectionNum );
}
);
Line 65 ⟶ 71:
$handlerLink
);
};
 
/**
* Actually show the handler for a given reporter name and section number.
*/
EFFPRH.showReporter = function ( reporterName, sectionNum ) {
const targetDivId = 'script-EFFPRH-' + sectionNum;
new Vue( {
el: '#' + targetDivId,
data: function () {
return {
reporterName: reporterName,
sectionNum: sectionNum
};
},
template: `<div>Section {{ sectionNum }} for report by {{ reporterName }}.</div>`
} );
};