Created
June 25, 2016 12:47
-
-
Save rla/91f3a1c8214c7f4bf634c14b021a3cbc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var control = require('../control'); | |
var checkbox = control.checkbox; | |
var text = control.text; | |
var select = control.select; | |
// Adds cabriolet properties to the vehicle. | |
exports.mixin = function(vehicle) { | |
vehicle.hardtop = checkbox({ | |
label: tr('post.hardtop') | |
}); | |
vehicle.softtop = checkbox({ | |
label: tr('post.softtop') | |
}); | |
vehicle.electrical_roof_opening = checkbox({ | |
label: tr('post.electrical_roof_opening') | |
}); | |
vehicle.electrical_roof_opening_remote = checkbox({ | |
label: tr('post.electrical_roof_opening_remote') | |
}); | |
vehicle.wind_blocker = checkbox({ | |
label: tr('post.wind_blocker') | |
}); | |
vehicle.neck_level_heating = checkbox({ | |
label: tr('post.neck_level_heating') | |
}); | |
vehicle.roll_bar = checkbox({ | |
label: tr('post.roll_bar') | |
}); | |
vehicle.conditional.cabriolet = ko.pureComputed(function() { | |
var body = vehicle.body.value(); | |
return vehicle.type.value() === 'passenger' && | |
(body === 'cabriolet' || body === 'suv_cabriolet' || body === 'roadster'); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment