guiled / lre Goto Github PK
View Code? Open in Web Editor NEWLet's Role Enhanced
Let's Role Enhanced
Cannont read property "name" of undefined
Lorsqu'on initialise un craft (autre main sheet) avec LRE, les events ne fonctionnent qu'à la première initialisation sur la table et tant que sa fenetre reste ouverte. Si on la ferme et la réouvre l'event ne fonctionne plus.
Code utilisé pour le test 👍
init = lre(function(sheet) {
if (sheet.id() === "main") {
initMain(sheet);
}else if(sheet.id() === "pnj"){
initPNJ(sheet);
}
});
const initMain = function(sheet) {
initInitiativeLight(sheet);
};
const initPNJ = function(sheet) {
initPNJ(sheet);
};
const initInitiativeLight = function(sheet){
sheet.get('label_initiative').on('click',function(){
let valeur = sheet.get('init_value').value()+"d6";
let dice = Dice.create(valeur).tag("initiative");
Dice.roll(sheet.raw(),dice,'initiative');
});
};
const initPNJ = function(sheet){
sheet.get('btn_test').on('click',function(){
log('click');
});
};
Ici, lorsqu'on ouvre un craft PNJ sur la table, le click sur btn_test fonctionne et log bien le click. Si on ferme craft et le reouvre, le click sur btn_test ne produit aucun log.
Si on désactive LRE, le click sur btn_test fonctionne à chaque fois.
When deleting in repeater the component cache is not up to date
sheet.setData() has a limitation of 20 items to set at a time, and don't support multiple calls in a short delay.
LRE should allow to set a big amount of data and prevent errors from too much data set.
When accessing to a component inside of a repeater entry, the component has a realId() with its entry id doubled
init = lre(function(sheet) {
let lbl = sheet.get('repeater').find('entryId').find('label');
log(lbl.realId());
}
repeater.entryId.label
repeater.entryId.entryId.label
Even if it works in Let's Role, this is theorically incorrect…
equipRepeater.on("edit",function(repeater, entry, entryId, data){
repeater.find(entryId).find("e1").on("update",function(){
log("update "+entry);
});
});
After clicking on edit icon, the update
event works fine.
Then click on done to save
Click on edit icon again, the update
event doesn't work anymore
Events should be triggered like with classic javascript engine just like a setTimeout(callback, 0)
That will prevent event loops, UI freeze on multiple event triggers
Same bug with Let's Role
when changing field value with setData()
and having value get in an on change event
setData trigger an error Uncaught TypeError: r.getPropertyObject(...) is undefined
This function will be called ONCE at the very firt init of a sheet…
Take attention of crafts
Implement the delegated events
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.