GithubHelp home page GithubHelp logo

lre's People

Contributors

guiled avatar

Watchers

 avatar  avatar

Forkers

tsuna77

lre's Issues

Event sur un CRAFT ne fonctionne qu'à la première initialisation du CRAFT sur la table

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.

Transparently byPass setData limitations

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.

Component in repeater entries has a bad realId()

When accessing to a component inside of a repeater entry, the component has a realId() with its entry id doubled

Code to reproduce

init = lre(function(sheet) {
    let lbl = sheet.get('repeater').find('entryId').find('label');
    log(lbl.realId());
}

Expected in log

repeater.entryId.label

Actual in log

repeater.entryId.entryId.label

Even if it works in Let's Role, this is theorically incorrect…

Event attach on Edit view component during edit works only once

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 updateevent works fine.
Then click on done to save
Click on edit icon again, the updateevent doesn't work anymore

Event triggers could be async

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.