summaryrefslogtreecommitdiffstats
path: root/web/widget/abstract/inline.js
blob: dedde36c9d60f9b72da56169aa244fd3a43bc305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (c) 2012-2014 Kaarle Ritvanen
 * See LICENSE file for license details
 */

define(
    ["aconf/statusbar", "aconf/widget/link", "jquery", "underscore"],
    function(statusBar, Base, $, _) {
	return Base.extend({
	    init: function(
		data, name, meta, level, editable, removable
	    ) {
		this.txnMgr = data.txnMgr;
		return Base.init.call(
		    this, data, name, meta, level, editable, removable
		);
	    },

	    staticRender: function(value, meta) { return null; },

	    createEl: function() { return $("<div>"); },

	    requestData: function(value, meta) {
		this.path = value;
		return this._requestData(value, meta);
	    },

	    _requestData: function(value, meta) {
		return Base.requestData.call(this, value, meta);
	    },

	    refreshData: function() {
		var def = $.Deferred();
		this.txnMgr.query(this.path).done(function(data) {
		    def.resolve(data, data.meta);
		});
		return def;
	    }
	});
    }
);