Rename AdditionalId to arg (closes #2465)

This commit is contained in:
FinnStutzenstein 2016-10-17 08:05:40 +02:00
parent c2a1675e37
commit 7fcbed051c
4 changed files with 16 additions and 17 deletions

View File

@ -369,9 +369,8 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
[{name: 'agenda/current-list-of-speakers-overlay',stable: true}]); [{name: 'agenda/current-list-of-speakers-overlay',stable: true}]);
} }
}, },
isProjected: function (additionalId) { isProjected: function () {
// Returns the id of the last projector with an agenda-item element. Else return 0. // Returns the id of the last projector with an agenda-item element. Else return 0.
// additionalId is not needed
var isProjected = 0; var isProjected = 0;
var predicate = function (element) { var predicate = function (element) {
var value; var value;

View File

@ -163,7 +163,7 @@
</button> </button>
<!-- Project --> <!-- Project -->
<projector-button model="assignment" default-projector-id="defaultProjectorId" <projector-button model="assignment" default-projector-id="defaultProjectorId"
additional-id="poll.id" content="{{ 'Project' | translate }}"> arg="poll.id" content="{{ 'Project' | translate }}">
</projector-button> </projector-button>
</div> </div>

View File

@ -320,10 +320,10 @@ angular.module('OpenSlidesApp.core', [
* This places a projector button in the document. * This places a projector button in the document.
* *
* Example: <projector-button model="motion" default-projector.id="defPrId" * Example: <projector-button model="motion" default-projector.id="defPrId"
* additional-id="2" content="{{ 'project' | translate }}"></projector-button> * arg="2" content="{{ 'project' | translate }}"></projector-button>
* This button references to model (in this example 'motion'). Also a defaultProjectionId * This button references to model (in this example 'motion'). Also a defaultProjectionId
* has to be given. In the example it's a scope variable. The next two parameters are additional: * has to be given. In the example it's a scope variable. The next two parameters are additional:
* - additional-id: Then the model.project and model.isProjected will be called with * - arg: Then the model.project and model.isProjected will be called with
* this argument (e. g.: model.project(2)) * this argument (e. g.: model.project(2))
* - content: A text placed behind the projector symbol. * - content: A text placed behind the projector symbol.
*/ */
@ -350,9 +350,9 @@ angular.module('OpenSlidesApp.core', [
scope.defaultProjectorId = defaultProjectorId; scope.defaultProjectorId = defaultProjectorId;
}); });
if (attributes.additionalId) { if (attributes.arg) {
scope.$watch(attributes.additionalId, function (id) { scope.$watch(attributes.arg, function (arg) {
scope.additionalId = id; scope.arg = arg;
}); });
} }

View File

@ -1,24 +1,24 @@
<div class="btn-group" style="min-width:{{ projectors.length > 1 ? '54' : '34' }}px;" uib-dropdown <div class="btn-group" style="min-width:{{ projectors.length > 1 ? '54' : '34' }}px;" uib-dropdown
uib-tooltip="{{ 'Projector' | translate }} {{ model.isProjected(additionalId) }}" uib-tooltip="{{ 'Projector' | translate }} {{ model.isProjected(arg) }}"
tooltip-enable="model.isProjected(additionalId) > 0" tooltip-enable="model.isProjected(arg) > 0"
os-perms="core.can_manage_projector"> os-perms="core.can_manage_projector">
<button type="button" class="btn btn-default btn-sm" <button type="button" class="btn btn-default btn-sm"
ng-click="model.project(defaultProjectorId, additionalId)" ng-click="model.project(defaultProjectorId, arg)"
ng-class="{ 'btn-primary': model.isProjected(additionalId) == defaultProjectorId }"> ng-class="{ 'btn-primary': model.isProjected(arg) == defaultProjectorId }">
<i class="fa fa-video-camera"></i> <i class="fa fa-video-camera"></i>
{{ content }} {{ content }}
</button> </button>
<button type="button" class="btn btn-default btn-sm slimDropDown" <button type="button" class="btn btn-default btn-sm slimDropDown"
ng-class="{ 'btn-primary': (model.isProjected(additionalId) > 0 && model.isProjected(additionalId) != defaultProjectorId) }" ng-class="{ 'btn-primary': (model.isProjected(arg) > 0 && model.isProjected(arg) != defaultProjectorId) }"
ng-if="projectors.length > 1" ng-if="projectors.length > 1"
uib-dropdown-toggle> uib-dropdown-toggle>
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li role="menuitem" ng-repeat="projector in projectors"> <li role="menuitem" ng-repeat="projector in projectors">
<a href="" ng-click="model.project(projector.id, additionalId)" <a href="" ng-click="model.project(projector.id, arg)"
ng-class="{ 'projected': (model.isProjected(additionalId) == projector.id) }"> ng-class="{ 'projected': (model.isProjected(arg) == projector.id) }">
<i class="fa fa-video-camera" ng-show="model.isProjected(additionalId) == projector.id"></i> <i class="fa fa-video-camera" ng-show="model.isProjected(arg) == projector.id"></i>
{{ projector.name }} {{ projector.name }}
<span ng-if="defaultProjectorId == projector.id">(<translate>Default</translate>)</span> <span ng-if="defaultProjectorId == projector.id">(<translate>Default</translate>)</span>
</a> </a>