A model of giant ELMs