Socket
Socket
Sign inDemoInstall

@open-e/oe-coordinator

Package Overview
Dependencies
5
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @open-e/oe-coordinator

This module is used to detect mouse movement on the border of HTMLElement. Useful usecase is to enable resize event in `div` element when mouse is on the border of it.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Open Editor - Coordinator

This module is used to detect mouse movement on the border of HTMLElement. Useful usecase is to enable resize event in div element when mouse is on the border of it.

How to use

Step 1: npm install @open-e/oe-coordinator
Step 2: import package
Step 3: Setting border css property to targeted HTMLElement

1. Detect on border of HTMLElement

Example

import { Component, ElementRef, OnInit } from "@angular/core";
import { Observable, of } from  "rxjs";
import { PublicAPI } from "@open-e/oe-coordinator";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.scss"]
})
export class AppComponent implements OnInit {
  title = "border-tester";
  private _coordinateService: PublicAPI.CoordinateComponent;

  constructor(private _ref: ElementRef) {}

  ngOnInit() {
    this._coordinateService = new PublicAPI.CoordinateComponent(
      document.querySelector('.container')
    );
  }

  onBorder($event) {
    console.log("on Border", $event.target, 'onBorder', this._coordinateService.onBorder());
    console.log ("onDragStartTest", this._coordinateService.onDragStart());
  }

  onMouseOver($event) {
    console.log("on Border", $event.target, 'onBorder', this._coordinateService.onBorder());
    console.log ("onDragStartTest", this._coordinateService.onDragStart());
  }
}

2. Trigger Dragging Menu

Step 1: Import Module

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { EngineModule  as EventEffectModule } from "@open-e/oe-coordinator";


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    EventEffectModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Step 2: Using in your component

import { Component} from "@angular/core";

@Component({
  selector: "app-root",
  template: `<div horizonDrag min="-200" max="500" 
             class="container"></div>`,
  styleUrls: ["./app.component.scss"]
})
export class AppComponent{
}

Trigger Zoom Effects

<div zoom-editor maxScale='4' minScale='0.5' accumulativeVal='0.1'></div>

Keywords

FAQs

Last updated on 01 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc