Use active class on wp watcher button

pull/3766/head
Magdalena Kafka 9 years ago
parent 5d173052ff
commit 1dab35e6ae
  1. 4
      frontend/app/templates/work_packages/watcher_button.html
  2. 2
      frontend/app/work_packages/directives/work-package-watcher-button-directive.js

@ -1,7 +1,7 @@
<button class="button" <button ng-click="toggleWatch()"
ng-click="toggleWatch()"
title="{{ buttonTitle }}" title="{{ buttonTitle }}"
ng-disabled="disabled" ng-disabled="disabled"
class="{{ buttonClass }}"
id="{{ buttonId }}"> id="{{ buttonId }}">
<i class="button--icon" ng-class="watchIconClass"></i> <i class="button--icon" ng-class="watchIconClass"></i>
<span class="button--text" <span class="button--text"

@ -54,11 +54,13 @@ module.exports = function(I18n, WorkPackageService) {
if (scope.isWatched) { if (scope.isWatched) {
scope.buttonTitle = I18n.t('js.label_unwatch_work_package'); scope.buttonTitle = I18n.t('js.label_unwatch_work_package');
scope.buttonText = I18n.t('js.label_unwatch'); scope.buttonText = I18n.t('js.label_unwatch');
scope.buttonClass = 'button -active';
scope.buttonId = 'unwatch-button'; scope.buttonId = 'unwatch-button';
scope.watchIconClass = 'icon-watch-1'; scope.watchIconClass = 'icon-watch-1';
} else { } else {
scope.buttonTitle = I18n.t('js.label_watch_work_package'); scope.buttonTitle = I18n.t('js.label_watch_work_package');
scope.buttonText = I18n.t('js.label_watch'); scope.buttonText = I18n.t('js.label_watch');
scope.buttonClass = 'button';
scope.buttonId = 'watch-button'; scope.buttonId = 'watch-button';
scope.watchIconClass = 'icon-not-watch'; scope.watchIconClass = 'icon-not-watch';
} }

Loading…
Cancel
Save