1// Nuno Faria (23-07-2015): comenteisto pq estava a criar problemas nas popups do primefaces 2/////* Patches javascript de frameworks / libs */ 3// 4///* Um pseudo-evento para ser utilizado pelo patch do PF.w.Dialog *exclusivamente* */ 5//$(window).resize(function () { 6// if (this.resizeTO) 7// clearTimeout(this.resizeTO); 8// this.resizeTO = setTimeout(function () { 9// $(this).trigger('resizeEnd'); 10// }, 500); 11//}); 12// 13///* -- PrimeFaces.widget.Dialog -- 14// * Override de parte do PF.w.Dialog (PrimeFaces 5.1) 15// * Suporta margens numa dialog maximizada, com uma margem top do tamanho do menu 16// * Actualiza posição da dialog no resize da janela 17// */ 18//PrimeFaces.widget.Dialog.prototype.toggleMaximize = function () { 19// if (this.minimized) { 20// this.toggleMinimize(); 21// } 22// if (this.maximized) { 23// this.jq.removeClass('ui-dialog-maximized'); 24// this.restoreState(); 25// this.maximizeIcon.children('.ui-icon').removeClass('ui-icon-newwin').addClass('ui-icon-extlink'); 26// this.maximized = false; 27// } 28// else { 29// this.saveState(); 30// var win = $(window); 31// // Margem top-r-b-l: 58-16-16-16 32// this.jq.addClass('ui-dialog-maximized').css({ 33// 'width': win.width() - 32 34// , 'height': win.height() - 72 35// }).offset({ 36// top: win.scrollTop() + 58 37// , left: win.scrollLeft() + 16 38// }); 39// //maximize content 40// this.content.css({ 41// width: 'auto', 42// height: 'auto' 43// }); 44// this.maximizeIcon.removeClass('ui-state-hover').children('.ui-icon').removeClass('ui-icon-extlink').addClass('ui-icon-newwin'); 45// this.maximized = true; 46// if (this.cfg.behaviors) { 47// var maximizeBehavior = this.cfg.behaviors['maximize']; 48// if (maximizeBehavior) { 49// maximizeBehavior.call(this); 50// } 51// } 52// } 53//} 54// 55//PrimeFaces.widget.Dialog.prototype.initPosition = function () { 56// //reset 57// this.jq.css({left: 0, top: 0}); 58// if (/(center|left|top|right|bottom)/.test(this.cfg.position)) { 59// this.cfg.position = this.cfg.position.replace(',', ' '); 60// this.jq.position({ 61// my: 'center' 62// , at: this.cfg.position 63// , collision: 'fit' 64// , of: window 65// //make sure dialog stays in viewport 66// , using: function (pos) { 67// var l = pos.left - 10 < 0 ? 0 : pos.left - 10, 68// t = pos.top < 58 ? 58 : pos.top; 69// $(this).css({ 70// left: l 71// , top: t 72// }); 73// } 74// }); 75// } 76// else { 77// var coords = this.cfg.position.split(','), 78// x = $.trim(coords[0]), 79// y = $.trim(coords[1]); 80// this.jq.offset({ 81// left: x 82// , top: y 83// }); 84// } 85// if (!this.positionInitialized) { 86// this.syncWindowResizeNonModal(); 87// } 88// this.positionInitialized = true; 89//} 90// 91//PrimeFaces.widget.Dialog.prototype.fitViewport = function () { 92// var winHeight = $(window).height() - 72, 93// contentPadding = this.content.innerHeight() - this.content.height(); 94// //console.log('winHeight: ' + winHeight); 95// //console.log('contentPadding: ' + contentPadding); 96// if (this.jq.innerHeight() > winHeight) { 97// //console.log('innerHeight() > winHeigh'); 98// this.content.height(winHeight - this.titlebar.innerHeight() - contentPadding); 99// } 100//} 101// 102//PrimeFaces.widget.Dialog.prototype.syncWindowResizeNonModal = function () { 103// $(window).off('resizeEnd.dialog_' + this.id); 104// $(window).on('resizeEnd.dialog_' + this.id, {dialog: this}, function (evt) { 105// if (evt.data.dialog.jq.hasClass('ui-overlay-visible')) { 106// if (!evt.data.dialog.jq.hasClass('ui-dialog-minimized')) 107// evt.data.dialog.initPosition(); 108// } else { 109// $(window).off('resizeEnd.dialog_' + evt.data.dialog.id); 110// } 111// }); 112//} 113// 114//PrimeFaces.widget.Dialog.prototype.show = function () { 115// if (this.jq.hasClass('ui-overlay-visible')) { 116// return; 117// } 118// if (!this.loaded && this.cfg.dynamic) { 119// this.loadContents(); 120// } 121// else { 122// // se a dialog for hide() e depois show(), vamos reiniciar a posição para o caso de um resize pelo meio 123// // divergindo do comportamento original 124// this.initPosition(); 125// if (this.positionInitialized) {// aplica listener do resize 126// this.syncWindowResizeNonModal(); 127// } 128// this._show(); 129// } 130//} 131///* -- FIM PrimeFaces.widget.Dialog -- */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.