mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-02 00:52:04 -04:00
SYWEB-98: Add a 'Redact' button to the event info modal dialog.
I think this is better than overriding the right-click contextual menu. Currently clicking this button does nothing.
This commit is contained in:
parent
ed241ba032
commit
70137409ed
2 changed files with 31 additions and 3 deletions
|
@ -985,10 +985,25 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
|
|||
};
|
||||
|
||||
$scope.openJson = function(content) {
|
||||
console.log("Displaying modal dialog for " + JSON.stringify(content));
|
||||
$scope.event_selected = content;
|
||||
// scope this so the template can check power levels and enable/disable
|
||||
// buttons
|
||||
$scope.pow = matrixService.getUserPowerLevel;
|
||||
|
||||
var modalInstance = $modal.open({
|
||||
template: "<pre>" + angular.toJson(content, true) + "</pre>"
|
||||
templateUrl: 'eventInfoTemplate.html',
|
||||
controller: 'EventInfoController',
|
||||
scope: $scope
|
||||
});
|
||||
};
|
||||
|
||||
}]);
|
||||
}])
|
||||
.controller('EventInfoController', function($scope, $modalInstance) {
|
||||
console.log("Displaying modal dialog for >>>> " + JSON.stringify($scope.event_selected));
|
||||
$scope.redact = function() {
|
||||
console.log("User level = "+$scope.pow($scope.room_id, $scope.state.user_id)+
|
||||
" Redact level = "+$scope.events.rooms[$scope.room_id]["m.room.ops_levels"].content.redact_level);
|
||||
console.log("Redact event >> " + JSON.stringify($scope.event_selected));
|
||||
$modalInstance.dismiss();
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue