{"size": 1649, "ext": "js", "max_stars_repo_path": "ProtocolOne/Controls/Tooltip.js", "max_stars_repo_name": "ProtocolONE/cord.app.ui", "max_stars_repo_stars_event_min_datetime": "2019-08-07T06:12:46.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-08T17:46:11.000Z", "max_issues_repo_path": "ProtocolOne/Controls/Tooltip.js", "max_issues_repo_name": "ProtocolONE/cord.app.ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "ProtocolOne/Controls/Tooltip.js", "max_forks_repo_name": "ProtocolONE/cord.app.ui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.4155844156, "max_line_length": 90, "alphanum_fraction": 0.5912674348}
.pragma library

var _tooltipObject = null;

function init(layer) {
    var component = Qt.createComponent('./Tooltip.qml');

    _tooltipObject = component.createObject(layer);
    if (!_tooltipObject) {
        throw new Error('FATAL: error creating Tooltip.qml - ' + component.errorString());
    }
}

 function isItemValid(item) {
    return (typeof item === 'object')
            && item.toString().indexOf('QML') !== -1
            && item.hasOwnProperty('entered')
            && typeof item.entered === 'function'
            && item.hasOwnProperty('exited')
            && typeof item.exited === 'function'
            && item.hasOwnProperty('toolTip')
            && typeof item.toolTip === 'string';
}

function track(item) {
    if (!isItemValid(item)) {
        console.log('FATAL: Invalid tooltip item object ' + item);
        return;
    }

    item.entered.connect(function() {
        entered(item)
    });

    item.exited.connect(function() {
        exited(item);
    });
}

function entered(item) {
    if (_tooltipObject) {
        _tooltipObject.entered(item);
    }
}

function exited(item) {
    if (_tooltipObject) {
        _tooltipObject.exited(item);
    }
}

function animationDuration() {
    if (_tooltipObject) {
        return _tooltipObject.animationDuration;
    }

    return 0;
}

function release(item) {
    if (!this.isItemValid(item)) {
        console.log('FATAL: Could not release tooltip item object ' + item);
        return;
    }

    if (_tooltipObject) {
        _tooltipObject.release(item);
    }
}

function releaseAll() {
    if (_tooltipObject) {
        _tooltipObject.releaseAll();
    }
}

