Skip to content

Commit ba6eaa5

Browse files
committed
Fixed bug with sending main view drawOptions to print view
1 parent 567bff0 commit ba6eaa5

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

assets/src/modules/sm/App/controllers/AppController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ angular.module('sm').controller("AppController", function($scope, localStorage,
1919
endDay: 6,
2020
bldgStyle: 'code',
2121
theme: 'woc',
22-
classDetails:'NPL'
22+
classDetails: 'NPL'
2323
};
2424

2525
$scope.state.displayOptions = {

assets/src/modules/sm/Schedule/controllers/ScheduleController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ angular.module('sm').controller("ScheduleController", function($scope, parsedSch
2323

2424
// Set the correct draw options
2525
for(var key in $scope.state.drawOptions) {
26-
$scope.overrideDrawOptions[key] = parsedSchedule[key];
26+
$scope.overrideDrawOptions[key] = parsedSchedule[key] || $scope.state.drawOptions[key];
2727
}
2828

2929
// Set image property

assets/src/modules/sm/Schedule/directives/scheduleDirective.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ angular.module('sm').directive('schedule', function($timeout, $filter) {
227227

228228
var update = function(options) {
229229
if(scope.scheduleController.init(options)) {
230+
scope.scheduleDrawOptions = options;
230231
// Only redraw if valid options
231232
scope.scheduleController.draw();
232233

assets/src/modules/sm/Schedule/templates/schedule.print.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ <h3 class="panel-title">
2020
<div class="form-group">
2121
<label for="printOptions-theme" class="col-sm-4 control-label">Theme:</label>
2222
<div class="col-sm-8">
23-
<select id="printOptions-theme" class="form-control" ng-model="state.drawOptions.theme" ng-options="opt.value as opt.label for opt in ui.optionLists.themeOptions"></select>
23+
<select id="printOptions-theme" class="form-control" ng-model="overrideDrawOptions.theme" ng-options="opt.value as opt.label for opt in ui.optionLists.themeOptions"></select>
2424
</div>
2525
</div>
2626
</div>
2727
<div class="col-sm-9">
2828
<div class="form-group">
2929
<label for="printOptions-classDetails" class="col-sm-3 control-label">Class Details:</label>
3030
<div class="col-sm-7">
31-
<select id="printOptions-classDetails" class="form-control" ng-model="state.drawOptions.classDetails" ng-options="opt.value as opt.label for opt in ui.optionLists.classDetailsOptions"></select>
31+
<select id="printOptions-classDetails" class="form-control" ng-model="overrideDrawOptions.classDetails" ng-options="opt.value as opt.label for opt in ui.optionLists.classDetailsOptions"></select>
3232
</div>
3333
</div>
3434
</div>

assets/src/modules/sm/Schedule/templates/scheduleitem.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="panel panel-default" ng-class="state.drawOptions.theme" schedule-actions>
1+
<div class="panel panel-default" ng-class="scheduleDrawOptions.theme" schedule-actions>
22
<div ng-show="!print" class="panel-heading">
33
<div class="row form-horizontal">
44
<div class="col-xs-12">
@@ -70,7 +70,7 @@ <h2 class="panel-title control-label pull-left smaller-sm">{{saveAction == "crea
7070
<div class="schedule-cont">
7171
<div class="schedule-track" ng-class="mobileTrackClass">
7272
<svg version="1.1" ng-attr-height="{{grid.opts.height}}" width="100%" xmlns="http://www.w3.org/2000/svg"><defs><pattern vector-effect="non-scaling-stroke" id="day{{initialIndex}}" width="100%" x="0" height="40" patternUnits="userSpaceOnUse"><line vector-effect="non-scaling-stroke" x1="0" y1="19.5" x2="100%" y2="19.5" style="stroke:#bbb;stroke-width:1" /></pattern></defs><rect x="0" y="0" width="100%" height="100%" fill="#ffffff" /><g ng-attr-transform="{{grid.opts.pixelAlignment}}" font-family="Roboto" font-size="15"><g class="svg-schedule-hours"><text fill="#aaa" text-anchor="end" ng-repeat="hour in grid.hours track by $index" ng-attr-x="{{print?'41':'5%'}}" ng-attr-y="{{($index * 40) + 25}}">{{hour}}</text></g><g ng-repeat="day in grid.days"><text y="12" ng-attr-x="{{day.offset}}" ng-attr-width="{{grid.opts.daysWidth}}" fill="#aaa" ng-bind="day.name"></text><rect y="19" ng-attr-x="{{day.offset}}" ng-attr-width="{{grid.opts.daysWidth}}" ng-attr-height="{{grid.opts.daysHeight}}" fill="url(#day{{initialIndex}})" /></g><g svg-schedule-item class="item" ng-mouseenter="itemEnter($event)" ng-mouseleave="itemLeave($event)" ng-repeat="item in scheduleItems | orderBy:'-boundry.y'"><rect ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y}}" ng-attr-width="{{item.boundry.width}}" ng-attr-height="{{item.boundry.height}}" ng-attr-fill="{{item.color}}" fill-opacity="1" /><rect ng-if="item.boundry.shorten != 0" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.shorten < 0 ?item.boundry.y : item.boundry.y + item.boundry.height - 2}}" ng-attr-width="{{item.boundry.width}}" height="2" fill="#ffff00" /><text svg-text-line="{{item.title}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 16}}" transform="translate(3,0)" font-weight="bold" fill="white"></text>
73-
<g ng-switch="state.drawOptions.classDetails">
73+
<g ng-switch="scheduleDrawOptions.classDetails">
7474
<g ng-switch-default>
7575
<text ng-if="item.boundry.height > 32 && item.content.courseNum" svg-text-line="{{item.content.courseNum}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 32}}" transform="translate(3,0)" fill="#fff"></text><text ng-if="item.boundry.height > 48 && item.content.instructor" svg-text-line="{{item.content.instructor}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 48}}" transform="translate(3,0)" fill="#fff"></text><text ng-if="item.boundry.height > 64 && item.content.location" svg-text-line="{{item.content.location}}" ng-attr-x="{{item.boundry.x}}" ng-attr-y="{{item.boundry.y + 64}}" transform="translate(3,0)" fill="#fff"></text>
7676
</g>

0 commit comments

Comments
 (0)