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 controller = new Controller({ | |
| loanCalcRegion: app.getRegion('loanCalc'), | |
| loanOrder: window.__DATA.order, | |
| yaCounter: window.yaCounter23682952, | |
| }); | |
| app.Router = new Marionette.AppRouter({ | |
| routes: { | |
| 'order': function() { |
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
| app.on('start', function() { | |
| if (Backbone.history) { | |
| var state = Backbone.history.start({ | |
| pushState: false, | |
| }); | |
| console.log("history started?"); | |
| } | |
| }) |
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
| Marionette.Module.extend = Marionette.extend; | |
| // Extend the Module prototype with events / listenTo, so that the module | |
| // can be used as an event aggregator or pub/sub. | |
| _.extend(Marionette.Module.prototype, Backbone.Events, { | |
| // Initialize is an empty function by default. Override it with your own | |
| // initialization logic when extending Marionette.Module. | |
| initialize: function(){}, | |
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
| Behaviors.Dialog = Marionette.Behavior.extend({ | |
| tiggers: { | |
| 'click .js-close-dialog': 'dialog:close' | |
| }, | |
| events: { | |
| 'click .js-close-dialog': 'closeDialog' | |
| }, | |
| initialize: function (opts) { | |
| this.$overlay = $(document).find('#modal-overlay') | |
| this.$content = $(document).find('#modal-content') |
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
| create: function (options) { | |
| var c = this; | |
| console.log("Layout created"); | |
| c.loanOrder.set('loan', options); // Set options from loan calc to loan order | |
| c.layout = new views.Layout(); | |
| c.layout.on('render', function() { | |
| c.infoPanel = new views.Panel({model: c.loanOrder}); | |
| c.layout.getRegion('infoPanel').show(c.infoPanel); | |
| c.renderStageForm(); |
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
| service.updateJob = function (orderId, attributes, done) { | |
| service.jobFieldsValidation.check(attributes).then(function (attributes){ | |
| var Order = derp.db.model('Order'); | |
| service.getById(orderId, { | |
| where: { | |
| stage: { | |
| $gte: Order.STAGE.PASSPORT, | |
| $lt: Order.STAGE.MISC_AND_CONFIRM | |
| } | |
| } |
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
| schema.path('passport.series').validate(function (value) { | |
| return /^\d{4}$/.test(value) | |
| }, 'Серия указана неверно') |
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
| StageOne: Marionette.ItemView.extend({ | |
| template: 'tpl-loan-form-1', | |
| behaviors: { | |
| Loadable: {}, | |
| Formable: { | |
| fields: { | |
| firstname: {}, | |
| middlename: {}, | |
| lastname: {}, | |
| gender: { |
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
| renderFirstStage: function () { | |
| var c = this; | |
| // Set default city, if we are not proceed to step2 (loan.office != null) | |
| var loan = c.loanOrder.get('loan'); | |
| if (!loan.office) { | |
| loan.city = shared.me.get('city').id; | |
| c.loanOrder.set('loan', loan); | |
| } |
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
| script(type="text/html", id="tpl-localSet-item") | |
| button.clear | |
| span {{ title }} | |
| span {{ showMetro }} | |
| {{#if hours}} | |
| {{#if isEveryday }} | |
| div.time | |
| span Ежедневно | |
| span {{ hours.workdays }} |