// +-------------------------------------------------+
// � 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: PMBDialog.js,v 1.1.18.1 2025/08/25 14:36:50 rtigero Exp $


define(["dojo/_base/declare", "dijit/Dialog", "dojo/_base/lang", "dojo/dom-class"], function(declare, Dialog, lang, domClass){

	  return declare([Dialog], {
		  show: function(){
			  this.inherited(arguments);
			  if (!domClass.contains(document.body, "dojoDialogOpened")){
				  domClass.add(document.body, "dojoDialogOpened");
			  }
			  //La fermeture de modale doit etre le premier element focusable
			  dojo.query(".dijitDialogCloseIcon", this.domNode).forEach(function(node) {
				  node.setAttribute("tabindex", "0");
			  });
		  },
		  hide: function(){
			  this.inherited(arguments);
			  if (domClass.contains(document.body, "dojoDialogOpened")){
				  domClass.remove(document.body, "dojoDialogOpened");
			  }
		  },
	  });
});