kumarsivarajan / mollify

Automatically exported from code.google.com/p/mollify
0 stars 0 forks source link

Client Settings - View plugin as default #534

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to be able to set the default OnClick action to display images 
using the FileViewerEditorPlugin.  Something like this:

"file-view": {
  actions: {
  onClick: function(item, ctx) {
    if (item.is_file) {
      if (ctx.viewtype == "icon") return "plugin-view";
      return "open_menu";
    }
    return "go_into_folder";
  }
}

It's easy enough to add this to the _handleCustomAction function, but I can't 
figure out how to execute the onView function callback.

What version of the product are you using? On what operating system?
Mollify 2.5.6 on Ubuntu 12.04

Please provide any additional information below.

Original issue reported on code.google.com by l...@d5.ca on 16 Apr 2014 at 4:11

GoogleCodeExporter commented 8 years ago
Plugin actions needs to be exposed somehow, right now they cannot be referred 
to like this.

I'd have to investigate if there could be a way to plugins register these 
action shortcuts, but until that I've exposed this action so it can be called 
from action handler

https://github.com/sjarvela/mollify/commit/dc2e124906743c47afceff6244a4ca8306204
1dc

It can be used like this:

    actions: {
        onDblClick: function(item, ctx) {
            mollify.plugins.get("plugin-fileviewereditor").view(item);
            return true;
        }
    }

Original comment by samuli.j...@gmail.com on 23 Apr 2014 at 3:42

GoogleCodeExporter commented 8 years ago
Works great!  Thanks!

Original comment by l...@d5.ca on 24 Apr 2014 at 2:06

GoogleCodeExporter commented 8 years ago
Released

Original comment by samuli.j...@gmail.com on 24 Apr 2014 at 2:47