breach / mod_strip

Breach default layout / tabbing module
38 stars 40 forks source link

Added ability to add bars from other modules #60

Open gammagec opened 10 years ago

gammagec commented 10 years ago

I have added the ability to call breach.module('mod_strip').call('addbar', { url: 'http://localhost:' + port + '/bar', dimension: 45, id: 'bookmarks' }, cb);

Which increases the height of the mod_strip strip bar and inserts an iframe with the new module underneath it. This can be done multiple times to add multiple other bars underneath the strip bar.

spolu commented 10 years ago

Hi this is great! Only ideally this should go through breach_core.

The idea would be to have the ability to add actions or apps to breach core and have whichever module you age using act on that central registry.

Do you think you can add a pr to breach core doing that and amend this one?

gammagec commented 10 years ago

Hi Spolu,

Are you saying just to put the bar's data (url, size, name) into breach core and then mod_strip read from breach_core what bars are there and will render them inside it's UI or are you suggesting that in the core to have 'add_control' have ability to add multiple controls with the TOP parameter and they just stack? Either way sounds good to me, although if you want the modules to be more independent the second way seems better.

spolu commented 10 years ago

The former solution. Have the ability to write action parameters in the core module and have mod_strip read them and render them.

The good parameters probably are:

size cannot be influenced by the caller as it entirely depends on the module that will display these actions.

Make sense?

gammagec commented 10 years ago

Hi Spolu,

I am planning to add entire bars from other modules underneath the mod_strip, not just actions.

so the bar mods themselves would define and render the icons. Mod strip would just create space underneath itself and put an iframe there that points to the new bar UI.

Although, I think you are right... mod_strip should also have the ability to have action buttons put inside of it. I felt that the mod_strip should be an empty container and the bar & tabs themselves should be separate modules that in turn push their content to the mod strip.

spolu commented 10 years ago

You should wait for next version to do that. Control will be able to inject arbitrary divs... But if you're still interested in doing the action API, let me know how I can help. This should be useful even in the next version.