lucky
Jun 03, 2026

I Left Before They Could Dump Eight Kids on My Porch. By Christmas Morning, My Daughter Was Begging Me to Come Home.

I Left Before They Could Dump Eight Kids on My Porch. By Christmas Morning, My Daughter Was Begging Me to Come Home.

Posted July 24, 2026

I Left Before They Could Dump Eight Kids on My Porch. By Christmas Morning, My Daughter Was Begging Me to Come Home.

The moment I heard my daughter laughing about abandoning her children at my house, something inside me went so still that even the coffee stopped trembling in my hand.

I was standing in my kitchen a week before Christmas, listening to the old coffee maker hiss and sputter, when her voice floated in from the living room.

“We’ll simply leave all eight kids at Mom’s,” she said. “She can look after them while we enjoy a few quiet days away.”

She laughed after she said it.

Not a guilty laugh.
Not an embarrassed laugh.
A comfortable laugh.

The kind of laugh people use when they believe something belongs to them.

I stood there in my slippers, my fingers wrapped around a mug I had bought at Target years ago, one that said World’s Best Grandma in fading red letters. For a few seconds, I couldn’t move. The Christmas music playing from the little radio by the sink suddenly sounded ridiculous, almost cruel.

Outside, my quiet street glittered like a holiday commercial. Each front yard had something glowing in it. Snowmen leaned in the breeze. Reindeer blinked. Garland hugged porch railings. My own house looked warm and welcoming from the outside, with white lights around the windows and a wreath on the door.

Inside, the pantry shelves were full. The freezer was packed. The gifts were wrapped and stacked beneath the tree. Eight grandchildren, each with carefully chosen presents. Dolls. Lego sets. Science kits. A basketball. Pajamas in the right sizes. Books chosen for each child, not just grabbed from a shelf.

I had done what I always did.

I had prepared Christmas.

Not because anyone asked nicely.
Not because anyone offered to help.
Because for years, I had been the woman everyone assumed would carry the holiday on her back and smile while doing it.

My name is Eleanor Whitaker. I am sixty-seven years old, widowed, and I live alone in the small two-story house my husband, Frank, and I bought when we were young enough to believe our children would always come home because they missed us.

For a long time, I believed that too.

Every Christmas, my house filled with noise. My daughter, Lauren, would arrive with her husband, Mark, and their four children. My son, Brian, would come with his wife, Melissa, and their four. Coats would pile on the staircase. Boots would scatter by the door. Someone would spill juice. Someone would cry over a toy. Someone would ask me where the tape was, where the gravy boat was, whether I had almond milk, whether I remembered that Tyler didn’t like onions anymore.

And I always remembered.

I remembered everyone.

I remembered Lauren liked cranberry sauce from the can, sliced into ridges. I remembered Brian hated turkey skin but loved the dark meat. I remembered Melissa didn’t eat pork. I remembered Mark took his coffee black. I remembered which child was allergic to walnuts, which one needed a night-light, which one cried if socks had seams.


But over the years, I began to notice something.

No one remembered me.

No one remembered that my knees hurt after standing all day.
No one remembered that the grocery bill came out of my pension.
No one remembered that I was the first person awake and the last person to bed.
No one remembered that after the last photo was posted online with captions like Family is everything, I was still in the kitchen, soaking pans in a sink cloudy with grease.

Last Christmas, I cooked for two full days.

Lauren and Mark arrived forty minutes late, blaming traffic though they lived twenty minutes away. Brian walked in ten minutes before dinner, carrying nothing but his phone and a distracted apology. They ate. They laughed. They took pictures beside the tree. Then, one by one, they explained that they had other plans.

The adults left.

The children stayed.

All eight of them.

I laid out air mattresses across the living room floor, tucked blankets around small shoulders, found lost stuffed animals, broke up arguments, cleaned frosting off the carpet, and sat awake until after midnight while the furnace hummed through the quiet house.

Not one person asked if I was tired.

On the morning after Christmas, Lauren kissed my cheek on her way out and said, “Mom, you’re a lifesaver.”

She meant it as a compliment.

I heard it as a sentence.

Now, in my kitchen, a week before another Christmas, I listened to her continue her phone conversation.

“Mom has taken care of all eight before,” Lauren said. “We’ll drop them off there, stay a few days at the beach hotel, then return on Christmas Day for dinner and gifts.”

My own daughter was planning a vacation from her children by turning me into a holiday storage unit.

I set the mug down carefully because my hands had begun to shake.

For a moment, I wanted to storm into the living room. I wanted to ask her when exactly she had planned to tell me that I would be responsible for eight children for three days. I wanted to ask whether my time mattered, whether my body mattered, whether my grief and loneliness and exhaustion mattered.

But then I heard her say something that made my chest go cold.

“She’ll say yes,” Lauren said. “She always does.”

There it was.

The truth, spoken plainly.

I had trained them to believe I would never refuse.

Lauren left an hour later with a quick hug and a distracted smile. She didn’t mention the beach hotel. She didn’t mention the children. She said, “See you soon, Mom,” as if my agreement had already been signed somewhere in invisible ink.

When the door closed behind her, I walked slowly upstairs to my bedroom.

Frank’s photograph sat on the dresser, the one from our twenty-fifth anniversary. He was laughing in it, his arm around me, his dark hair already turning silver at the temples. He had been gone for six years, but some days I still turned to tell him things.

That day, I sat on the edge of the bed and looked at him for a long time.

“What would you do?” I whispered.

Of course, the picture didn’t answer.

But I knew.

Frank had loved our children fiercely, but he had never confused love with surrender. He used to say, “A family that only gathers around your table but never notices your empty chair is not gathering for you.”

I had forgotten that.

Or maybe I had been too afraid to remember.

That afternoon, I opened a notebook.

I wrote three words at the top of a blank page.

Not this year.

Then I made phone calls.

The first was to a hotel on the coast, a place Frank and I had visited once when we were newly married and too poor to afford anything except one night in a small room with a crooked balcony and a view of the Atlantic. I expected them to be fully booked, but the woman at the desk paused after I gave my name.

“Mrs. Whitaker?” she asked.

“Yes.”

There was a strange silence.

Then she said, “We actually have a reservation under that name.”

I frowned. “That’s impossible. I haven’t stayed there in years.”

“It appears to be a standing reservation,” she said. “December twenty-third through twenty-sixth. Paid in advance.”

My heart thudded once.

“Paid by whom?”

Another pause.

“I’m not sure I’m supposed to discuss that over the phone, ma’am. But there’s a note on the booking. It says the guest should receive an envelope upon arrival.”

An envelope.

I almost canceled right then. It felt too strange, too delicate, like touching a bruise.

But something in me whispered, Go.

So I confirmed the reservation.

Then I called a neighbor, Mrs. Alvarez, and asked if she would keep an eye on the house. I told her there might be some confusion with my family and that she was not to let anyone in unless I called her personally.

She was quiet for half a second, then said, “Good for you, Eleanor.”

I hadn’t told her the details.

Apparently, women like us recognize each other’s silences.

On December 23, I woke before sunrise.

The house was decorated beautifully. The tree glowed in the living room. The stockings hung in a row. The dining table was bare. The oven was cold.

I stood in the doorway of the kitchen and felt something unexpected.

Not guilt.

Grief, maybe. Fear, certainly. But underneath it was a small, bright spark of relief.

For the first time in years, Christmas morning was not waiting to devour me.

I packed one suitcase. Not much. A few sweaters. My toiletries. A book I had been trying to read for months. Frank’s photograph, slipped carefully between two folded scarves.

Before leaving, I walked to the tree.

The gifts for the grandchildren were still there. I had not returned them. I had not punished the children for their parents’ assumptions. Each present had a name tag in my handwriting.

But beside the gifts, I placed eight small envelopes.

Each one contained a note.

Grandma loves you very much. This year, Christmas dinner is not at my house. Your parents will explain. I will see you soon.

Then I locked the door.

The key turned with a small, sharp click.

It sounded like a period at the end of a very long sentence.

As I rolled my suitcase down the driveway, I looked back once. My house stood there under its Christmas lights, warm and pretty and empty.

Then I got into my car and drove toward the ocean.

For the first thirty minutes, I kept expecting my phone to ring.

It didn’t.

The highway opened ahead of me, gray under a winter sky. Bare trees lined the road like witnesses. I drove past shopping centers crowded with last-minute buyers, past gas stations with wreaths on the doors, past families in minivans headed toward other families.

Around noon, my phone finally buzzed.

Lauren.

I let it ring.

It stopped.

Buzzed again.

Brian.

I let that one ring too.

Then the messages began.

Mom, we’re at your house. Where are you?

The door is locked.

Did you go to the store?

Mom, answer your phone.

Then Lauren called again.

This time, I pulled into a rest area and answered.

“Mom?” Her voice was high and tight. Children shouted in the background. “Where are you?”

I looked through the windshield at the cold blue sky.

“I’m on my way to the coast.”

Silence.

“What do you mean, the coast?”

“I mean the ocean, Lauren.”

A door slammed on her end. She lowered her voice. “Mom, this isn’t funny. We’re here with the kids.”

“I assumed you were.”

“Then why aren’t you home?”

I took a breath. It shook less than I expected.

“Because I was not asked to watch eight children for three days.”

Another silence, longer this time.

Then she said, “You overheard that?”

“Yes.”

“Mom, it wasn’t like that.”

“It sounded exactly like that.”

Her tone changed instantly, slipping from shock to frustration. “We just needed a break. You know how hard things have been.”

“I do know hard things, Lauren.”

“That’s not fair.”

“No,” I said quietly. “It isn’t.”

In the background, one of the children asked, “Is Grandma coming back?”

My heart twisted.

Lauren said, “Mom, please. We already booked the hotel.”

“I know.”

“So what are we supposed to do?”

There it was again.

Not Are you okay?
Not I’m sorry.
Not We should have asked.

What are we supposed to do?

I looked at my own reflection in the windshield. I looked older than I felt and younger than I had yesterday.

“You are their parents,” I said. “You will figure it out.”

Then I ended the call.

My hands trembled afterward, but not from regret.

From freedom.

By late afternoon, the road began to smell faintly of salt. The sky widened. The traffic thinned. When the ocean finally appeared, dark and silver beyond the dunes, I cried so suddenly that I had to pull over.

Not because I was sad.

Because I had forgotten the world was this big.

The Harbor Light Inn stood where it always had, perched at the edge of a sleepy coastal town with shingled shops, weathered fences, and gulls screaming overhead. It had been renovated since Frank and I last came, but the bones were the same. White siding. Blue shutters. A porch facing the sea.

Inside, a young woman at the desk asked for my name.

“Eleanor Whitaker.”

Her expression shifted.

“Oh,” she said softly. “Yes. We’ve been expecting you.”

I felt the hairs rise on my arms.

She handed me a brass key and then, with both hands, a sealed cream envelope.

On the front, in handwriting I knew better than my own, was my name.

Ellie.

No one had called me that since Frank died.

I stood there in the lobby with the envelope in my hands, unable to breathe.

“Would you like to sit down?” the young woman asked gently.

I nodded.

There was a small sitting room off the lobby with a fireplace and windows looking out at the ocean. I sat in a leather chair near the fire and opened the envelope with shaking fingers.

Inside was a letter.

My dearest Ellie,

If you are reading this, it means you finally came.

I pressed the paper to my mouth.

I made this reservation every Christmas for ten years after my diagnosis. I knew you would not come while I was alive, because you would say the children needed us. And after I was gone, I feared you would say they needed you even more.

The room blurred.

But I also knew there would come a day when you would be tired enough, hurt enough, or brave enough to choose yourself. I wanted somewhere waiting when you did.

A sound escaped me, half laugh, half sob.

There is something else you need to know. I made arrangements with Nora Bennett, our attorney. I asked her to contact you only if you arrived at this inn for Christmas. Not before. You would have ignored her. You always were stubborn when it came to your own happiness.

I could hear his voice in every word.

Call her. Trust her. And Ellie, listen carefully: love is not measured by how much you let people take from you.

The letter ended with three words.

Go see everything.

I read it three times.

Then I called the number written at the bottom.

Nora Bennett answered on the second ring. She had been our family attorney for decades, a sharp woman with silver glasses and a voice like polished stone.

“Eleanor,” she said. “I wondered when you would call.”

“You knew?”

“I knew Frank hoped.”

“What is happening, Nora?”

She sighed, not sadly, but with the weight of someone opening a locked drawer.

“Frank left instructions. If you ever used the Harbor Light reservation, I was to meet you the next day and explain certain matters regarding the house, the trust, and your children.”

“My children?”

“Yes,” she said. “And I’m afraid this may be difficult.”

The next morning was Christmas Eve.

Nora arrived at the inn wearing a dark wool coat and carrying a leather folder. We sat in the same room by the fireplace while outside the ocean threw itself against the rocks.

She opened the folder.

“Frank changed his will two years before he died,” she said.

“I know. Everything went to me.”

“Not everything.” She looked at me carefully. “He created a family trust. Your house is yours for life, entirely protected. No one can force you out, sell it, borrow against it, or pressure you into transferring it. After your death, it does not automatically pass to Lauren and Brian.”

I blinked. “It doesn’t?”

“No. Not unless certain conditions are met.”

“What conditions?”

Nora slid a document toward me.

“Frank was worried about how they treated you even then.”

I wanted to defend them automatically. The instinct rose in me like a reflex.

But the words died before reaching my mouth.

Nora continued, “The trust states that Lauren and Brian may inherit only if they demonstrate sustained care for you, not financial dependence on you, not coercion, and not abandonment of responsibility. Frank knew legal language couldn’t force love. But it could prevent exploitation.”

I stared at her.

“Why didn’t he tell me?”

“Because he knew you would undo it to avoid conflict.”

That was true.

It hurt because it was true.

Nora removed another paper. “There is more.”

My stomach tightened.

“Three months ago,” she said, “Lauren and Brian contacted my office.”

I went cold.

“For what?”

“They asked about transferring the house into their names while you were still living.”

The room tilted slightly.

“They said it was for estate planning,” Nora continued. “But when I refused to proceed without speaking to you privately, Brian became angry. Lauren asked whether your signature could be obtained during the holidays because, and I quote, ‘Mom is always emotional around Christmas and easier to talk into things.’”

I felt the blood drain from my face.

Easier to talk into things.

Not mother. Not widow. Not person. Asset.

Nora’s expression softened. “I’m sorry, Eleanor.”

I looked out at the ocean. Waves rose and collapsed, rose and collapsed.

For years I had mistaken being needed for being loved.

“What happens now?” I asked.

“Now,” Nora said, “you decide how much access they have to your life. The house is safe. Your pension is safe. Your accounts are safe. Frank also left a separate fund in your name, accessible once you came here.”

I turned back slowly.

“A fund?”

“Yes.”

“How much?”

Nora told me.

For a moment, I thought I had misheard.

It was not billionaire money. It was not movie money. But it was more than enough to change the rest of my life. Enough to travel. Enough to repair the house. Enough to stop worrying about groceries after buying Christmas gifts. Enough to breathe.

“Frank called it your freedom fund,” Nora said.

I covered my face.

That night, Lauren called seventeen times.

Brian called nine.

I answered neither.

But on Christmas morning, after a quiet breakfast overlooking the sea, I listened to Lauren’s voicemail.

Her voice was different now.

Not angry.

Afraid.

“Mom, please call me. The kids are asking questions. Brian is furious. Mark says you embarrassed everyone. I don’t know what to tell people. Please just come home so we can talk.”

I deleted it.

Brian’s message was worse.

“Mom, this is childish. You made your point. We need to discuss the house paperwork anyway, so stop avoiding us.”

There it was.

The house paperwork.

I sat very still.

Then I called Nora.

By noon, we had a plan.

By three o’clock Christmas afternoon, I was driving home.

Not because they summoned me.

Because I was ready.

Snow began falling as I turned onto my street. My house glowed at the end of the block, surrounded by blinking lights and inflatable snowmen rocking in the wind. Lauren’s SUV was in the driveway. Brian’s truck was behind it. Mark and Melissa’s cars sat along the curb.

They had let themselves into the yard but not the house.

Mrs. Alvarez had kept her promise.

When I pulled up, everyone turned.

The children ran first.

“Grandma!”

All eight of them came toward me in a wave of coats and mittens and red cheeks. I hugged them one by one, holding them tightly. None of this was their fault. Children inherit the weather adults create; they do not choose the storm.

Lauren stood by the porch, pale and stiff.

Brian looked angry enough to crack his teeth.

“Mom,” Lauren said. “Where have you been?”

“At the coast.”

“You ruined Christmas.”

I looked at her for a long second.

“No,” I said. “I stopped being the only person responsible for making it.”

Brian stepped forward. “Can we go inside and talk like adults?”

“Of course.”

They looked relieved.

Then I added, “Nora is joining us.”

Their faces changed.

It was subtle, but I saw it.

Fear.

Nora arrived ten minutes later, walking up my driveway in her dark coat like a judge in a Christmas movie no one wanted to be in. We gathered in my living room, the tree glowing behind us, gifts still untouched beneath it.

The children sat in the den with cookies Mrs. Alvarez had brought over. The adults stood around my living room like people waiting for a verdict.

Nora opened her folder.

Brian spoke first. “This is ridiculous.”

“No,” I said. “What’s ridiculous is trying to arrange the transfer of my house behind my back.”

Lauren’s eyes filled instantly. “Mom, that wasn’t—”

“Don’t,” I said.

One word.

She stopped.

The room went silent.

I had never spoken to her like that before.

I looked from my daughter to my son. “For years, I thought if I gave enough, cooked enough, hosted enough, paid enough, forgave enough, eventually you would notice me. But you didn’t. You noticed what I could do for you.”

Brian’s jaw tightened. “That’s not fair.”

I smiled sadly. “You keep using that word.”

Nora laid the trust document on the coffee table.

“Your father protected me,” I said. “From this house being taken. From pressure. From guilt. From signatures slipped under Christmas dinner plates.”

Lauren began to cry.

But this time, her tears did not move me the way they once would have.

Not because I didn’t love her. Because I finally loved myself too.

Then came the twist none of them expected.

I picked up eight envelopes from beside the tree.

Lauren looked confused. “What are those?”

“These,” I said, “are for the children.”

Brian frowned. “What kind of envelopes?”

“College accounts,” Nora answered.

Everyone froze.

I looked toward the den, where the grandchildren were laughing softly over cookies.

“Frank and I started funds for each grandchild when they were born,” I said. “Small at first. Then Frank added more before he died. I continued when I could. I was going to tell you all this Christmas.”

Lauren pressed a hand to her mouth.

“But after what I learned,” I continued, “Nora and I made a change.”

Brian’s eyes narrowed. “What change?”

“The funds will remain for the children. But neither of you will ever control a dollar of them.”

Lauren’s face crumpled.

Brian said, “You can’t do that.”

“I already did.”

Nora nodded. “The accounts are now protected education trusts. The grandchildren can access them for college, trade school, housing while studying, or starting adult life at twenty-five. Their parents cannot withdraw from them, borrow against them, or redirect them.”

Mark muttered something under his breath.

Melissa stared at the floor.

I thought that was the end.

It wasn’t.

The real shock came from the hallway.

A small voice said, “Mom?”

We all turned.

My oldest granddaughter, Sophie, stood there. She was thirteen, too thin for her age, with Lauren’s eyes and a trembling chin.

“Sophie,” Lauren said sharply, “go back with the kids.”

But Sophie didn’t move.

She looked at me.

“Grandma,” she whispered, “is this why Mom said you had to sign papers before we could move in?”

The room stopped breathing.

I stared at Lauren.

“Move in?” I asked.

Lauren’s face went white.

Brian closed his eyes.

And in that instant, I understood there had been an even bigger plan than the one I had overheard.

Nora’s voice turned icy. “Lauren. Explain.”

No one spoke.

So Sophie did.

“She said after Christmas, we were going to stay here for a while because our house has too many bills,” Sophie said, tears gathering in her eyes. “She said you wouldn’t mind because you get lonely. She said Uncle Brian might bring his family too until things got settled.”

My knees nearly gave out.

Eight children for three days had never been the whole plan.

They were not just going to use my Christmas. They were going to take my home, room by room, guilt by guilt, until I was a guest in the house my husband had protected for me.

Lauren sobbed. “Mom, we were desperate.”

I looked at her, and for the first time, I saw not a little girl needing help but a grown woman who had mistaken my love for a weakness she could manage.

“You could have told me the truth,” I said.

“You would have said no.”

“Yes,” I replied. “I would have.”

The simplicity of it stunned all of us.

Brian rubbed his forehead. “Mom, we’re drowning. The businesses, the mortgages, the credit cards—”

“And your solution was to drown me too?”

He had no answer.

The children had grown quiet in the den. I could feel them listening. That broke my heart more than anything.

So I did something none of the adults expected.

I walked to the den doorway and smiled at my grandchildren.

“Who wants to open presents?”

Their faces lit cautiously, looking from me to their parents and back again.

Lauren whispered, “Mom…”

I turned to her.

“The children will have Christmas,” I said. “You will not ruin that too.”

We opened gifts on the living room floor. The adults sat stiffly around the edges, humbled into silence. The children laughed, thanked me, hugged me. Sophie held onto me a little longer than usual.

Later, after cocoa and cookies, I stood.

“Here is what happens next,” I said.

Every adult looked at me.

“You will all leave tonight. The children may visit me another day, when arrangements are made respectfully and in advance. I am not a hotel. I am not a daycare. I am not your retirement plan, your emergency fund, your storage room, or your signature.”

Lauren cried silently.

Brian stared at the carpet.

“I love you,” I said. “But love without boundaries becomes a place where resentment grows. I should have learned that sooner. I’m learning it now.”

Then I delivered the final surprise.

“I’m selling this house.”

Lauren gasped. “What?”

Brian’s head snapped up. “You just said it was protected.”

“It is,” Nora said. “Which means Eleanor can decide what to do with it.”

I looked around the living room. The tree. The stockings. The walls filled with photographs of people who had smiled here without seeing me.

“I thought this house was the heart of our family,” I said. “But a heart cannot keep beating for people who only come to drain it.”

Lauren shook her head. “Where will you go?”

I smiled.

“To the coast.”

No one spoke.

“The Harbor Light Inn has a small cottage behind it,” I said. “Frank bought it quietly years ago through the trust. I learned that yesterday.”

Lauren’s mouth fell open.

Even Nora looked faintly amused; apparently she had saved that detail for me to reveal.

“It needs paint,” I continued. “And the porch leans a little. But it faces the ocean. Frank left it for me. Not for all of you. For me.”

The snow tapped softly against the windows.

For once, my children had nothing to say.

Three months later, I stood on the porch of my blue-shuttered cottage by the Atlantic, watching gulls wheel over the water. My old house had sold to a young family with two little boys and a golden retriever. They sent me a photo after moving in, all of them standing under the porch light, smiling like the house was beginning again.

Lauren and Brian did not forgive me immediately.

That was all right.

I had not chosen peace because it would please them.

But something unexpected happened with the grandchildren.

They wrote.

Sophie wrote first.

Grandma, I’m sorry you were sad. I didn’t know. Mom says grown-up things are complicated, but I think people should ask before they make plans for other people.

I taped that letter to my refrigerator.

By spring, the children began visiting one at a time or two at a time, never all eight unless I invited them. We walked on the beach. We made pancakes. We talked. Not about guilt. Not about obligation. About school, friends, books, dreams.

One Saturday in May, Sophie sat beside me on the sand and asked, “Grandma, were you scared when you left?”

I watched the waves fold themselves onto the shore.

“Yes,” I said.

“Then why did you do it?”

I thought of the locked front door. The cold oven. The suitcase in my trunk. Frank’s letter waiting at the inn. Lauren’s shocked face. Brian’s anger. The truth spilling from a child’s mouth.

Then I looked at my granddaughter.

“Because sometimes,” I said, “the door you’re most afraid to close is the one keeping you trapped.”

She leaned her head on my shoulder.

The wind smelled of salt and sun-warmed wood. My little cottage waited behind us, imperfect and mine. My phone was quiet. My hands were empty. For the first time in years, no one needed me to cook, clean, babysit, pay, fix, host, rescue, or disappear inside my own life.

And that was the most shocking ending of all.

I did not lose my family when I stopped letting them use me.

May you like

I found out who was willing to love me when I was no longer useful.

Report this article

Select a reason for reporting:

Inaccurate information Copyright violation Spam / advertisement Offensive content Other '; footer.hidden = true; overlay.hidden = false; document.body.style.overflow = 'hidden'; } function hideSection() { if (section) section.hidden = true; } function openModal() { if (alreadyReported) { showSuccess(); return; } overlay.hidden = false; document.body.style.overflow = 'hidden'; } function closeModal() { overlay.hidden = true; document.body.style.overflow = ''; footer.hidden = false; overlay.querySelectorAll('input[name="report_reason"]').forEach(function(r) { r.checked = false; }); document.getElementById('reportMessage').value = ''; errorBox.hidden = true; submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; imageItems = []; imgGrid.innerHTML = ''; updateAttachBtn(); } btn.addEventListener('click', openModal); closeBtn.addEventListener('click', closeModal); cancelBtn.addEventListener('click', closeModal); overlay.addEventListener('click', function(e) { if (e.target === overlay) closeModal(); }); document.addEventListener('keydown', function(e) { if (!overlay.hidden && e.key === 'Escape') closeModal(); }); // --- Error helper --- function showError(msg) { errorBox.textContent = msg; errorBox.hidden = false; } // --- Submit --- submitBtn.addEventListener('click', function() { var selected = overlay.querySelector('input[name="report_reason"]:checked'); if (!selected) { showError('Please select a reason.'); return; } errorBox.hidden = true; submitBtn.disabled = true; var itemsToUpload = imageItems.filter(function(it) { return !it.uploadedUrl; }); if (itemsToUpload.length === 0) { doSubmit(selected.value); return; } submitBtn.textContent = 'Uploading…'; var done = 0, failed = 0; itemsToUpload.forEach(function(entry) { entry.statusEl.textContent = '…'; entry.statusEl.className = 'report-img-item__status'; entry.statusEl.hidden = false; resizeImage(entry.file, MAX_LONG_PX, function(resized) { uploadFile(resized, currentSlug, function(err, url) { done++; if (err) { failed++; entry.statusEl.textContent = 'Failed'; entry.statusEl.className = 'report-img-item__status err'; } else { entry.uploadedUrl = url; entry.statusEl.textContent = '✓'; entry.statusEl.className = 'report-img-item__status done'; } if (done === itemsToUpload.length) { if (failed > 0) { showError('Could not upload ' + failed + ' image(s). Remove the failed ones (red) or submit without them.' ); submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; } else { doSubmit(selected.value); } } }); }); }); }); function doSubmit(reason) { submitBtn.textContent = 'Sending…'; var uploadedUrls = imageItems .map(function(it) { return it.uploadedUrl; }) .filter(Boolean); var payload = { reason: reason, message: document.getElementById('reportMessage').value.trim(), post_slug: currentSlug, post_url: window.location.href }; if (uploadedUrls.length) payload.image_urls = uploadedUrls; fetch('/api/post-report', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest' }, body: JSON.stringify(payload) }) .then(function(r) { return r.json(); }) .then(function(data) { if (data && data.ok) { markReported(currentSlug); alreadyReported = true; bodyEl.innerHTML = '✓ Thank you for your report.'; footer.hidden = true; setTimeout(function() { closeModal(); footer.hidden = false; hideSection(); }, 2000); } else { showError((data && data.message) ? data.message : 'Something went wrong. Please try again.'); submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; } }) .catch(function() { showError('Connection failed. Please try again.'); submitBtn.disabled = false; submitBtn.textContent = 'Submit report'; }); } })();

Comments 0

Posting as Guest

Other posts