| Line 223... |
Line 223... |
| 223 |
fileMimeType = $( this ).data( 'mime-type' ),
|
223 |
fileMimeType = $( this ).data( 'mime-type' ),
|
| 224 |
label = 'Aide pour : ' + $( this ).data( 'name' );
|
224 |
label = 'Aide pour : ' + $( this ).data( 'name' );
|
| Line 225... |
Line 225... |
| 225 |
|
225 |
|
| 226 |
if( fileMimeType.match( 'image' ) ) {
|
226 |
if( fileMimeType.match( 'image' ) ) {
|
| 227 |
var extention = fileMimeType.replace( /(?:imag)?e\/?/g , '' ),
|
227 |
var extention = fileMimeType.replace( /(?:imag)?e\/?/g , '' ),
|
| 228 |
content = '<img src="' + lthis.cheminFichiers + thisFieldKey + '.' + extention + '" style="max-width:100%" alt="' + thisFieldKey + '" />';
|
228 |
content = '<img id="modale-aide-img" src="' + lthis.cheminFichiers + thisFieldKey + '.' + extention + '" style="" alt="' + thisFieldKey + '" />';
|
| 229 |
}
|
229 |
}
|
| 230 |
lthis.activerModale( label, content );
|
230 |
lthis.activerModale( label, content );
|
| 231 |
});
|
231 |
});
|
| Line 239... |
Line 239... |
| 239 |
var fileMimeType = $( this ).data( 'mime-info' ),
|
239 |
var fileMimeType = $( this ).data( 'mime-info' ),
|
| 240 |
label = 'Aide du projet : ' + $( '#titre-projet' ).text();
|
240 |
label = 'Aide du projet : ' + $( '#titre-projet' ).text();
|
| Line 241... |
Line 241... |
| 241 |
|
241 |
|
| 242 |
if( fileMimeType.match( 'image' ) ) {
|
242 |
if( fileMimeType.match( 'image' ) ) {
|
| 243 |
var extention = fileMimeType.replace( /(?:imag)?e\/?/g , '' ),
|
243 |
var extention = fileMimeType.replace( /(?:imag)?e\/?/g , '' ),
|
| 244 |
content = '<img src="' + lthis.cheminFichiers + 'info.' + extention + '" style="max-width:100%" alt="info projet" />';
|
244 |
content = '<img id="modale-aide-img" src="' + lthis.cheminFichiers + 'info.' + extention + '" style="" alt="info projet" />';
|
| 245 |
}
|
245 |
}
|
| 246 |
lthis.activerModale( label, content );
|
246 |
lthis.activerModale( label, content );
|
| 247 |
});
|
247 |
});
|
| Line 267... |
Line 267... |
| 267 |
// Remplacer l'autofocus qui ne fonctionne plus en HTML5
|
267 |
// Remplacer l'autofocus qui ne fonctionne plus en HTML5
|
| 268 |
// Message dans la doc de bootstrap :
|
268 |
// Message dans la doc de bootstrap :
|
| 269 |
// Due to how HTML5 defines its semantics,
|
269 |
// Due to how HTML5 defines its semantics,
|
| 270 |
// the autofocus HTML attribute has no effect in Bootstrap modals.
|
270 |
// the autofocus HTML attribute has no effect in Bootstrap modals.
|
| 271 |
// To achieve the same effect, use some custom JavaScript
|
271 |
// To achieve the same effect, use some custom JavaScript
|
| 272 |
$( '#fenetre-modal' ).on( 'shown.bs.modal' , function () {
|
272 |
$( '#fenetre-modal' ).off( 'shown.bs.modal' ).on( 'shown.bs.modal' , function () {
|
| 273 |
$( '#myInput' ).trigger( 'focus' );
|
273 |
$( '#myInput' ).trigger( 'focus' );
|
| - |
|
274 |
if( lthis.valOk( $( '#modale-aide-img' ) ) ) {
|
| - |
|
275 |
lthis.redimentionnerImgAide();
|
| - |
|
276 |
$( window ).on( 'resize', lthis.redimentionnerImgAide.bind( lthis ) );
|
| - |
|
277 |
}
|
| 274 |
});
|
278 |
});
|
| 275 |
if ( this.valOk( buttons ) ) {
|
279 |
if ( this.valOk( buttons ) ) {
|
| 276 |
buttonsHtml = '';
|
280 |
buttonsHtml = '';
|
| 277 |
$.each( buttons, function( i, button ) {
|
281 |
$.each( buttons, function( i, button ) {
|
| 278 |
dismiss = button.dismiss ? 'data-dismiss="modal"' : '';
|
282 |
dismiss = button.dismiss ? 'data-dismiss="modal"' : '';
|
| Line 286... |
Line 290... |
| 286 |
$( '#print_content' ).empty();
|
290 |
$( '#print_content' ).empty();
|
| 287 |
$( '.modal-footer' ).html( buttonsHtmlBase );
|
291 |
$( '.modal-footer' ).html( buttonsHtmlBase );
|
| 288 |
});
|
292 |
});
|
| 289 |
};
|
293 |
};
|
| Line -... |
Line 294... |
| - |
|
294 |
|
| - |
|
295 |
Utils.prototype.redimentionnerImgAide = function() {
|
| - |
|
296 |
var espHorizDisp = $( '.modal-dialog' ).innerWidth() <= 768 ? $( '.modal-dialog' ).innerWidth() - 30 : 768,
|
| - |
|
297 |
cssImg = {
|
| - |
|
298 |
'width': espHorizDisp,
|
| - |
|
299 |
'height' : 'auto'
|
| - |
|
300 |
};
|
| - |
|
301 |
|
| - |
|
302 |
$( '#modale-aide-img' ).css(cssImg).show(50);
|
| - |
|
303 |
};
|
| 290 |
|
304 |
|
| 291 |
// Faire apparaitre un champ text "Autre"
|
305 |
// Faire apparaitre un champ text "Autre"
|
| 292 |
Utils.prototype.onOtherOption = function() {
|
306 |
Utils.prototype.onOtherOption = function() {
|
| Line 293... |
Line 307... |
| 293 |
const PREFIX = 'collect-other-';
|
307 |
const PREFIX = 'collect-other-';
|