getpattern should return object or array
devmondo opened this issue · 2 comments
hi,
get pattern returns a string of concatenated items, this makes it impossible to get pattern sequence so for example if i have this custom mapped object
Object {1: "g2eseuvgqnrbpgb9", 2: "fvfhvwn2eff4unmi", 3: "0nyolfdr5fry66r", 4: "s140yzaojsi9hpvi", 5: "ttzqe3nl95dn29", 6: "v0rdm725pie019k9", 7: "yz9aqdih4p1fw29", 8: "6oghs2o44hrggb9", 9: "hn85fnxflzcnxw29"}
i want to know the sequence user did to get those patterns.
i think join
here is the problem for getpattern()
https://github.com/s-yadav/patternLock/blob/master/patternLock.js#L299
and here for onDraw()
https://github.com/s-yadav/patternLock/blob/master/patternLock.js#L182
if we get the ability to pass separator, or return the pure array without joining it would solve the problem :)
thanks in advanced.
Added a delimiter option, which will be used to combine pattern sequence.
Usage example
var lock = new PatternLock('#container',{
delimiter : "$"
});
// then lock.getPattern() will give something like 1$2$5$7
awesome man , thank you very much :)