Skip to content

Commit

Permalink
_options.readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasz75 committed Dec 22, 2020
1 parent 2283815 commit 9b19cd0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
35 changes: 19 additions & 16 deletions app/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,33 @@
}
_build();

if (!_options.readonly){
_multiSelect();
}
_multiSelect();

}

function _multiSelect(){
// multi select mode
parentDiv.on('mousedown', function() {
// Do not take any immediate action - just set the holdStarter
// to wait for the predetermined delay, and then begin a hold
holdStarter = setTimeout(function() {
holdStarter = null;
holdActive = true;
// begin hold-only operation here, if desired
$('html').addClass('multiSelectMode');
}, holdDelay);
if (!_options.readonly){
// Do not take any immediate action - just set the holdStarter
// to wait for the predetermined delay, and then begin a hold
holdStarter = setTimeout(function() {
holdStarter = null;
holdActive = true;
// begin hold-only operation here, if desired
$('html').addClass('multiSelectMode');
}, holdDelay);
}
});

$(document).on('mouseup', function() {
// If the mouse is released immediately (i.e., a click), before the
// holdStarter runs, then cancel the holdStarter and do the click
$('html').removeClass('multiSelectMode');
clearTimeout(holdStarter);
holdActive = false;
if (!_options.readonly){
// If the mouse is released immediately (i.e., a click), before the
// holdStarter runs, then cancel the holdStarter and do the click
$('html').removeClass('multiSelectMode');
clearTimeout(holdStarter);
holdActive = false;
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}
i.AddIcon > svg{
height: 1em;
}</style><body style="margin-top: 2em"><div id=bipSchedule_parent style="float:left; display: inline-block"><p>xxxx</p></div><script src=scripts/834911ac.vendor.js></script><script src=scripts/3b4e87ba.main.js></script><script>var clickB;
}</style><body style="margin-top: 2em"><div id=bipSchedule_parent style="float:left; display: inline-block"><p>xxxx</p></div><script src=scripts/834911ac.vendor.js></script><script src=scripts/4856dade.main.js></script><script>var clickB;
// This is last toggled block via multiselect
var gMultiSelectToogleBlockId = null;
// test url
Expand Down
Loading

0 comments on commit 9b19cd0

Please sign in to comment.