Fix popup to properly call moodlle openpopup js function