Subversion Repositories eFlore/Applications.cel

Rev

Rev 3844 | Rev 3859 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3844 Rev 3852
Line 211... Line 211...
211
  // Due to how HTML5 defines its semantics,
211
  // Due to how HTML5 defines its semantics,
212
  // the autofocus HTML attribute has no effect in Bootstrap modals.
212
  // the autofocus HTML attribute has no effect in Bootstrap modals.
213
  // To achieve the same effect, use some custom JavaScript
213
  // To achieve the same effect, use some custom JavaScript
214
  $( '#fenetre-modal' ).off( 'shown.bs.modal' ).on( 'shown.bs.modal' , function () {
214
  $( '#fenetre-modal' ).off( 'shown.bs.modal' ).on( 'shown.bs.modal' , function () {
215
    $( '#myInput' ).trigger( 'focus' );
215
    $( '#myInput' ).trigger( 'focus' );
216
    if( lthis.valOk( $( '#modale-aide-img' ) ) ) {
216
    if( valOk( $( '#modale-aide-img' ) ) ) {
217
      lthis.redimentionnerImgAide();
217
      lthis.redimentionnerImgAide();
218
      $( window ).on( 'resize', lthis.redimentionnerImgAide.bind( lthis ) );
218
      $( window ).on( 'resize', lthis.redimentionnerImgAide.bind( lthis ) );
219
    }
219
    }
220
  });
220
  });
221
  if ( this.valOk( buttons ) ) {
221
  if ( valOk( buttons ) ) {
222
    buttonsHtml = '';
222
    buttonsHtml = '';
223
    $.each( buttons, function( i, button ) {
223
    $.each( buttons, function( i, button ) {
224
      dismiss = button.dismiss ? 'data-dismiss="modal"' : '';
224
      dismiss = button.dismiss ? 'data-dismiss="modal"' : '';
225
      buttonsHtml += '<button type="button" class="btn ' + button.class + '" ' + dismiss + '>' + button.label + '</button>';
225
      buttonsHtml += '<button type="button" class="btn ' + button.class + '" ' + dismiss + '>' + button.label + '</button>';
226
    });
226
    });
Line 288... Line 288...
288
    if( $( this ).hasClass( 'is-select' ) ) {
288
    if( $( this ).hasClass( 'is-select' ) ) {
289
      dataName  = $( this ).data( 'name' );
289
      dataName  = $( this ).data( 'name' );
290
      otherId   = PREFIX + dataName;
290
      otherId   = PREFIX + dataName;
291
      dataLabel = $( '.select' ).data( 'label' );
291
      dataLabel = $( '.select' ).data( 'label' );
292
      // Insertion du champ "Autre" après les boutons
292
      // Insertion du champ "Autre" après les boutons
293
      if ( !lthis.valOk( $( '#'+otherId ) ) ) {
293
      if ( !valOk( $( '#'+otherId ) ) ) {
294
        optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
294
        optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
295
      }
295
      }
296
    } else if ( $( this ).is( ':checked' ) ) {
296
    } else if ( $( this ).is( ':checked' ) ) {
297
      dataName  = $( this ).data( 'name' );
297
      dataName  = $( this ).data( 'name' );
298
      otherId   = PREFIX + dataName;
298
      otherId   = PREFIX + dataName;
299
      dataLabel = $( this ).data( 'label' );
299
      dataLabel = $( this ).data( 'label' );
300
      element = $( this ).data( 'element' );
300
      element = $( this ).data( 'element' );
301
      // Insertion du champ "Autre" après les boutons
301
      // Insertion du champ "Autre" après les boutons
302
      if ( !lthis.valOk( $( '#'+ otherId ) ) ) {
302
      if ( !valOk( $( '#'+ otherId ) ) ) {
303
        optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
303
        optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
304
      }
304
      }
305
    }
305
    }
306
  });
306
  });
Line 309... Line 309...
309
    dataName  = $( this ).data( 'name' );
309
    dataName  = $( this ).data( 'name' );
310
    otherId   = PREFIX + dataName;
310
    otherId   = PREFIX + dataName;
311
    dataLabel = $( this ).data( 'label' );
311
    dataLabel = $( this ).data( 'label' );
312
    if( 'other' === $( this ).val() ) {
312
    if( 'other' === $( this ).val() ) {
313
        // Insertion du champ "Autre" après les boutons
313
        // Insertion du champ "Autre" après les boutons
314
        if ( !lthis.valOk( $( '#'+otherId ) ) ) {
314
        if ( !valOk( $( '#'+otherId ) ) ) {
315
          optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
315
          optionAdd( otherId, $( this ).parent( '.add-field-select' ), 'select', dataName, dataLabel );
316
        }
316
        }
317
      } else {
317
      } else {
318
        // Suppression du champ autre
318
        // Suppression du champ autre
319
        optionRemove( otherId );
319
        optionRemove( otherId );
Line 325... Line 325...
325
    dataName = $( this ).data( 'name' );
325
    dataName = $( this ).data( 'name' );
326
    otherId  = PREFIX + dataName;
326
    otherId  = PREFIX + dataName;
327
    dataLabel = $( this ).data( 'label' );
327
    dataLabel = $( this ).data( 'label' );
328
    if( 'other' === $( this ).val() ) {
328
    if( 'other' === $( this ).val() ) {
329
      // Insertion du champ "Autre" après les boutons
329
      // Insertion du champ "Autre" après les boutons
330
      if ( !lthis.valOk( $( '#'+otherId ) ) ) {
330
      if ( !valOk( $( '#'+otherId ) ) ) {
331
        optionAdd( otherId, $( this ).parent( 'label' ), 'radio', dataName, dataLabel );
331
        optionAdd( otherId, $( this ).parent( 'label' ), 'radio', dataName, dataLabel );
332
      }
332
      }
333
    } else {
333
    } else {
334
      // Suppression du champ autre
334
      // Suppression du champ autre
335
      optionRemove( otherId );
335
      optionRemove( otherId );
Line 342... Line 342...
342
    otherId  = PREFIX + dataName;
342
    otherId  = PREFIX + dataName;
343
    dataLabel = $( this ).data( 'label' );
343
    dataLabel = $( this ).data( 'label' );
344
    element = $( this ).data( 'element' );
344
    element = $( this ).data( 'element' );
345
    if( $( this ).is( ':checked' ) ) {
345
    if( $( this ).is( ':checked' ) ) {
346
        // Insertion du champ "Autre" après les boutons
346
        // Insertion du champ "Autre" après les boutons
347
        if ( !lthis.valOk( $( '#'+otherId ) ) ) {
347
        if ( !valOk( $( '#'+otherId ) ) ) {
348
          optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
348
          optionAdd( otherId, $( this ).parent( 'label' ), element, dataName, dataLabel );
349
        }
349
        }
350
      } else {
350
      } else {
351
        // Suppression du champ autre
351
        // Suppression du champ autre
352
        optionRemove( otherId );
352
        optionRemove( otherId );