A left click on a flagged cell will unflag it. Don't remember why I implemented it this way. Maybe for touch screens which don't have the right click functionality.
What I'm referring to though is the case where left-clicking on an UNflagged square flags it. Doesn't seem like that should happen. I'm not sure exactly when it was happening - perhaps the first left click after a right-click flag? Or the first one after a chord?
On right click you set app.flagMode to true, but you don't unset it during or after the cellClicked call, so the first left click after a right is treated as another right.
A left click on a flagged cell will unflag it. Don't remember why I implemented it this way. Maybe for touch screens which don't have the right click functionality.
Btw, source is here: http://ronilan.com/bugsweeper/js/bugsweeper.js it is with jquery. Don't ask me why.