Merge pull request #2978 from FinnStutzenstein/MotionBlockAutoupdate
Fixing MotionBlock autoupdate and added projector button (fixes #2958)
This commit is contained in:
commit
8adbb1218f
@ -74,10 +74,10 @@ class MotionBlockSlide(ProjectorElement):
|
|||||||
|
|
||||||
def get_collection_elements_required_for_this(self, collection_element, config_entry):
|
def get_collection_elements_required_for_this(self, collection_element, config_entry):
|
||||||
output = super().get_collection_elements_required_for_this(collection_element, config_entry)
|
output = super().get_collection_elements_required_for_this(collection_element, config_entry)
|
||||||
# Full update if a motion changes because then it may be appended to
|
# Send all changed motions to the projector, because it may be appended
|
||||||
# or removed from the block.
|
# or removed from the block.
|
||||||
if collection_element.collection_string == Motion.get_collection_string():
|
if collection_element.collection_string == Motion.get_collection_string():
|
||||||
output.extend(self.get_requirements_as_collection_elements(config_entry))
|
output.append(collection_element)
|
||||||
return output
|
return output
|
||||||
|
|
||||||
def update_data(self):
|
def update_data(self):
|
||||||
|
@ -106,7 +106,17 @@ angular.module('OpenSlidesApp.motions.motionBlock', [])
|
|||||||
'ngDialog',
|
'ngDialog',
|
||||||
'MotionBlock',
|
'MotionBlock',
|
||||||
'MotionBlockForm',
|
'MotionBlockForm',
|
||||||
function ($scope, ngDialog, MotionBlock, MotionBlockForm) {
|
'Projector',
|
||||||
|
'ProjectionDefault',
|
||||||
|
function ($scope, ngDialog, MotionBlock, MotionBlockForm, Projector, ProjectionDefault) {
|
||||||
|
$scope.$watch(function () {
|
||||||
|
return Projector.lastModified();
|
||||||
|
}, function () {
|
||||||
|
var projectiondefault = ProjectionDefault.filter({name: 'motionBlocks'})[0];
|
||||||
|
if (projectiondefault) {
|
||||||
|
$scope.defaultProjectorId = projectiondefault.projector_id;
|
||||||
|
}
|
||||||
|
});
|
||||||
// Two-way data binding for all MotionBlock instances.
|
// Two-way data binding for all MotionBlock instances.
|
||||||
MotionBlock.bindAll({}, $scope, 'motionBlocks');
|
MotionBlock.bindAll({}, $scope, 'motionBlocks');
|
||||||
|
|
||||||
|
@ -25,10 +25,14 @@
|
|||||||
<table class="table table-striped table-bordered table-hover">
|
<table class="table table-striped table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th os-perms="core.can_manage_projector" class="minimum">
|
||||||
<th><translate>Name</translate>
|
<th><translate>Name</translate>
|
||||||
<th><translate>Motions</translate>
|
<th><translate>Motions</translate>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="motionBlock in motionBlocks | filter: filter.search | orderBy: 'title'">
|
<tr ng-repeat="motionBlock in motionBlocks | filter: filter.search | orderBy: 'title'">
|
||||||
|
<td os-perms="core.can_manage_projector">
|
||||||
|
<projector-button model="motionBlock" default-projector-id="defaultProjectorId">
|
||||||
|
</projector-button>
|
||||||
<td ng-mouseover="motionBlock.hover=true" ng-mouseleave="motionBlock.hover=false">
|
<td ng-mouseover="motionBlock.hover=true" ng-mouseleave="motionBlock.hover=false">
|
||||||
<strong>
|
<strong>
|
||||||
<a ui-sref="motions.motionBlock.detail({id: motionBlock.id})">{{ motionBlock.title }}</a>
|
<a ui-sref="motions.motionBlock.detail({id: motionBlock.id})">{{ motionBlock.title }}</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user