Fixed the loss of modal attribute by extending jQuery with fn.modal