forked from e-mission/e-mission-phone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Final attempt at generalization for now
- Create a "Config" in the top-level survey module for the multi-label survey - Switch the list views to use the configurations to figure the service and filters - Switch the HTML to use the configurations to the extent possible. This extent is the linkedtag attribute of the `verifycheck` element. Alas, we can't appear to set the element directive tag name directly (see ) e-mission/e-mission-docs#674 (comment) to e-mission/e-mission-docs#674 (comment) + move the one-click `verifycheck` button outside of `multilabel` since it is explicitly designed for use with other kinds of surveys as well
- Loading branch information
Showing
9 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
angular.module('emission.survey.multilabel.verifycheck', | ||
['emission.survey.multilabel.services', | ||
'emission.main.diary.services']) | ||
.directive('verifycheck', function($timeout) { | ||
return { | ||
scope: { | ||
linkedtag: "@", | ||
trip: "=", | ||
invokedfrom: "=" | ||
}, | ||
controller: "OneClickButtonCtrl", | ||
templateUrl: 'templates/survey/multilabel/one-click-button.html' | ||
}; | ||
}) | ||
.controller("OneClickButtonCtrl", function($scope, $element, $attrs) { | ||
var findLinkedLabelScope = function() { | ||
console.log("$element is ", $element, "linkedtag is ",$scope.linkedTag); | ||
console.log("parent row is", $element.parents("ion-item")); | ||
let rowElement = $element.parents("ion-item") | ||
console.log("row Element is", rowElement); | ||
let linkedlabel = rowElement.find($scope.linkedtag); | ||
console.log("child linkedlabel is", linkedlabel); | ||
let linkedlabelScope = angular.element(linkedlabel).isolateScope(); | ||
console.log("linkedlabel scope is", linkedlabelScope); | ||
return linkedlabelScope; | ||
}; | ||
|
||
$scope.verifyTrip = function() { | ||
let linkedLabelScope = findLinkedLabelScope(); | ||
linkedLabelScope.verifyTrip(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.