Produced by Araxis Merge on 12/7/2018 11:36:04 AM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | C:\SCRUB\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\new-appointment-request\views\requests\date-time | section-view.js | Mon Oct 22 23:25:20 2018 UTC |
| 2 | C:\MHED-scrubbed\MHED\MHED\VAR 4.10.0\var-web-release-4.10@e10f18de1ef\veteran-appointment-requests\app\modules\new-appointment-request\views\requests\date-time | section-view.js | Fri Dec 7 13:07:42 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 288 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | // normall y the mode l is passe d to the v iew instea d of the v iew creati ng the mod el | |
| 2 | define([ | |
| 3 | 'under score', | |
| 4 | 'momen t', | |
| 5 | 'mario nette', | |
| 6 | 'modul es/form/se ction-view ', | |
| 7 | 'json! modules/ne w-appointm ent-reques t/views/re quests/for m.json', | |
| 8 | ], | |
| 9 | function( | |
| 10 | _, | |
| 11 | moment , | |
| 12 | Marion ette, | |
| 13 | Sectio nView, | |
| 14 | metada ta | |
| 15 | ) { | |
| 16 | 'use s trict'; | |
| 17 | ||
| 18 | return SectionVi ew.extend( { | |
| 19 | mo delEvents: {}, | |
| 20 | in itialize: function(o ptions) { | |
| 21 | var sect ionName; | |
| 22 | var rule s; | |
| 23 | this._se ctionNumbe r = option s.sectionN umber; | |
| 24 | this.mod el = optio ns.model; | |
| 25 | sectionN ame = 'req uest-detai ls-date-ti me-' + thi s._section Number + ' -section'; | |
| 26 | if (opti ons.isCCRe quest) { | |
| 27 | rule s = { | |
| 28 | 'formatted Date': tru e, | |
| 29 | 'dateInRan ge': true, | |
| 30 | 'uniqueDat e': 'optio nDate', | |
| 31 | }; | |
| 32 | _.ex tend(metad ata.sectio ns[this._s ectionNumb er].questi ons[0].val idate.rule s, rules); | |
| 33 | } else { | |
| 34 | rule s = { | |
| 35 | 'formatted Date': tru e, | |
| 36 | 'dateInRan ge': true, | |
| 37 | }; | |
| 38 | meta data.secti ons[this._ sectionNum ber].quest ions[0].va lidate.rul es = rules ; | |
| 39 | } | |
| 40 | this.leg end = this .getLegend FromMetada ta(section Name, meta data, fals e) || ''; | |
| 41 | this.col lection = this.getQu estionsFro mMetadata( sectionNam e, metadat a); | |
| 42 | this.set Collection MinMaxDate s(options. minDate, o ptions.max Date); | |
| 43 | this.set TimeQuesti onModel(); | |
| 44 | ||
| 45 | // to do set this. model equa l to optio ns.model i f defined | |
| 46 | // initi alize list ener to 'c hange:valu e' after s tatic valu es are set | |
| 47 | this.ini tializeQue stionEvent Listeners( ); | |
| 48 | }, | |
| 49 | se tCollectio nMinMaxDat es: functi on(minDate , maxDate) { | |
| 50 | if (!_.i sUndefined (minDate) && !_.isUn defined(ma xDate)) { | |
| 51 | this .collectio n.each(fun ction(mode l) { | |
| 52 | if (model. get('type' ) === 'tex t-datepick er') { | |
| 53 | model. set('min', minDate); | |
| 54 | model. set('max', maxDate); | |
| 55 | } | |
| 56 | }); | |
| 57 | } | |
| 58 | }, | |
| 59 | se tTimeQuest ionModel: function() { | |
| 60 | var opti onDateId = 'optionDa te' + this ._sectionN umber; | |
| 61 | var opti onTimeId = 'optionTi me' + this ._sectionN umber; | |
| 62 | var valu es = []; | |
| 63 | var self = this; | |
| 64 | ||
| 65 | if (this .collectio n.get(opti onDateId). get('requi red')) { | |
| 66 | this .collectio n.get(opti onTimeId). set('selec ted', 'AM' ); | |
| 67 | this .collectio n.get(opti onTimeId). set('value ', 'AM'); | |
| 68 | } | |
| 69 | ||
| 70 | if (!thi s.model.ge t(optionTi meId)) { | |
| 71 | valu es = this. collection .get(optio nTimeId).g et('values ') | |
| 72 | .map(funct ion(value) { | |
| 73 | value. disabled = self._sec tionNumber !== 1; | |
| 74 | return value; | |
| 75 | }); | |
| 76 | } else { | |
| 77 | valu es = this. collection .get(optio nTimeId).g et('values ') | |
| 78 | .map(funct ion(value) { | |
| 79 | value. disabled = false; | |
| 80 | return value; | |
| 81 | }); | |
| 82 | } | |
| 83 | this.col lection.ge t(optionTi meId).set( 'values', values); | |
| 84 | }, | |
| 85 | on Render: fu nction() { | |
| 86 | this.ini tChildren( ); | |
| 87 | this.lis tenTo(this .model, 'c hange:opti onDate' + this._sect ionNumber, this.upda teOptionTi meQuestion ); | |
| 88 | }, | |
| 89 | up dateOption TimeQuesti on: functi on() { | |
| 90 | var $opt ionTime; | |
| 91 | var opti onDateStri ng; | |
| 92 | var opti onTimeStri ng; | |
| 93 | ||
| 94 | if (!thi s.isDestro yed()) { | |
| 95 | $opt ionTime = this.$el.f ind('.form -input-tim epicker'); | |
| 96 | opti onDateStri ng = 'opti onDate' + this._sect ionNumber; | |
| 97 | opti onTimeStri ng = 'opti onTime' + this._sect ionNumber; | |
| 98 | ||
| 99 | if ( this.model .has(optio nDateStrin g) && this .model.get (optionDat eString) ! == '' && | |
| 100 | _.isDateSt ring(this. model.get( optionDate String))) { | |
| 101 | if ($optio nTime.find ('input'). prop('disa bled')) { | |
| 102 | // thi s sets the default t ime value for the no nrequired times | |
| 103 | this.m odel.set(o ptionTimeS tring, 'AM '); | |
| 104 | $optio nTime.find ('input[va lue="AM"]' ).prop('ch ecked', tr ue); | |
| 105 | $optio nTime.find ('input') | |
| 106 | .p rop('disab led', fals e) | |
| 107 | .p arent('lab el') | |
| 108 | .r emoveClass ('ui-disab led'); | |
| 109 | // $op tionTime.f ind('input ').each(). prop('disa bled',fals e); | |
| 110 | } // else already en abled | |
| 111 | } el se { | |
| 112 | $optionTim e.find('in put').prop ('checked' , false); | |
| 113 | $optionTim e.find('in put') | |
| 114 | .prop( 'disabled' , true) | |
| 115 | .paren t('label') | |
| 116 | .addCl ass('ui-di sabled'); | |
| 117 | } | |
| 118 | } | |
| 119 | }, | |
| 120 | updateF DNS el: functi on(model) { | |
| 121 | var id = model.get ('id'); | |
| 122 | var val = model.ge t('value') ; | |
| 123 | ||
| 124 | if (type of gas !== 'undefine d') { | |
| 125 | gas( 'send', 'e vent', 've teran-appo intment', 'appointme nt-request -time-sele cted', mod el.get('id ')); | |
| 126 | } | |
| 127 | ||
| 128 | if (id.i ndexOf('op tionDate') !== -1) { | |
| 129 | if ( moment(val ).isValid( )) { | |
| 130 | this.model .set(id, m oment(val) .format('M M/DD/YYYY' )); | |
| 131 | } el se { | |
| 132 | this.model .unset(id) ; | |
| 133 | ||
| 134 | } | |
| 135 | // w hen: value has been set to emp ty string (e.g. eras ed) | |
| 136 | // t hen: we cl ear out ti me as well | |
| 137 | if ( !val) { | |
| 138 | this.model .unset('op tionTime' + this._se ctionNumbe r, ''); | |
| 139 | } | |
| 140 | } else i f (id.inde xOf('optio nTime') != = -1) { | |
| 141 | this .model.set (id, val); | |
| 142 | } | |
| 143 | }, | |
| 144 | }); | |
| 145 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.