diff --git a/js/SelectionViewModel.js b/js/SelectionViewModel.js index 94d63e0..46f2026 100755 --- a/js/SelectionViewModel.js +++ b/js/SelectionViewModel.js @@ -51,6 +51,21 @@ function SelectionViewModel(svgViewModel, materialViewModel, selectionGroup) { return selectionGroup.selectAll("path"); } + self.selectAll = function () { + self.clearSelection(); + + console.log("Select All triggered"); + + var paths = contentGroup.selectAll("path"); + + paths.forEach(function (elem) { + var snapElem = Snap(elem); + self.clickOnSvg(snapElem); + }); + + console.log("Final number of selected paths:", self.selNumSelected()); + }; + self.clearSelection = function () { selectionGroup.selectAll("path").remove(); self.selNumSelected(0); @@ -75,3 +90,5 @@ function SelectionViewModel(svgViewModel, materialViewModel, selectionGroup) { } } } + + diff --git a/jscut.html b/jscut.html index 621c49c..91b8804 100644 --- a/jscut.html +++ b/jscut.html @@ -504,13 +504,29 @@
| - | + | + | + |
| - | + | + + | ++ |