Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dismissible notification boxes
03-07-2018, 08:17 AM,
#21
RE: Dismissible notification boxes
Another possibility is to place an empty <div> element where you want the notifications to appear. Draw them at the bottom in the footer with the display attribute set to "none", then use the initial() javascript function to move them to the empty div and change the display attribute to "inline"

Tim
Reply
03-07-2018, 09:02 AM,
#22
RE: Dismissible notification boxes
Looks like it's shaping up! ...I was about to ask if some help might be needed with this feature, do you have a branch with those changes?
Reply
03-09-2018, 09:09 PM,
#23
RE: Dismissible notification boxes
I'll stick it all in a feature branch later today and share.

I would prefer to keep the notification messages within page flow, so like your suggestion.

Can you help with the Javascript?
Why would we need to switch the display attribute to inline?

Andy.
https://www.linkedin.com/in/andrewcouling
Reply
03-09-2018, 09:38 PM,
#24
RE: Dismissible notification boxes
Am more than happy to help Andy, just let me know.

What I was suggesting was that the display attribute was set to "none" when the PHP created them, so that they weren't drawn by the browser. Then after moving them change this setting to inline (block might work as well) so they then appear in the right place.

Tim
Reply
03-09-2018, 09:59 PM,
#25
RE: Dismissible notification boxes
I'll create the feature branch firstly, then share.

(03-09-2018, 09:38 PM)falkoner Wrote: What I was suggesting was that the display attribute was set to "none" when the PHP created them, so that they weren't drawn by the browser. Then after moving them change this setting to inline (block might work as well) so they then appear in the right place.

That makes sense.

Thanks.

Andy.
https://www.linkedin.com/in/andrewcouling
Reply
03-12-2018, 10:35 AM,
#26
RE: Dismissible notification boxes
I've managed to move the messages from the footer to the header, using appendChild().
I'm struggling with setting display correctly.
The messages appear momentarily in the footer, before moving to the header.
If I set display: none in the footer, then this style seems to carry over to the header.
Some help with this would be appreciated.

The feature branch is at https://github.com/andrewcouling/webERP/...ssible-msg

Andy.
https://www.linkedin.com/in/andrewcouling
Reply
03-12-2018, 05:53 PM, (This post was last modified: 03-12-2018, 06:15 PM by TimSchofield.)
#27
RE: Dismissible notification boxes
Hi Andy, to change the style attribute the following should work:

cD.style["display"] = "inline";

where cD is the Id of the element. You can see examples of my doing this in the customised alert boxes in my code.
Let me know if this works or not,
Tim
Reply
03-12-2018, 08:24 PM,
#28
RE: Dismissible notification boxes
Hi Andy, I see you have got them displaying. I have set up a demo here https://weberp.kwamoja.org/index.php so people can see how it looks. For some reason when Iog in I don't see anything below the header but when I click "add to menu" it becomes visible. I had a very quick look and couldn't immediately see why?

Tim
Reply
03-12-2018, 09:46 PM,
#29
RE: Dismissible notification boxes
Thanks Tim.
It worked fine on XAMMP with almost up-to-date repo code.
The modified files themselves were current when I branched.
I'm away from my development machine today. Will have a look this evening.

The message div at 35% width looks crap on a mobile device. I think I'll revert to full width.

Andy.
https://www.linkedin.com/in/andrewcouling
Reply
03-12-2018, 11:47 PM,
#30
RE: Dismissible notification boxes
It's probably my setup, I did it in a hurry. The main point was to showcase the notifications so it doesn't really matter. I think they look really good. I like the size and positioning on my laptop, but I can see maybe they don't look good on a mobile device.

Tim
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)