@@ -18,7 +18,6 @@ define([
18
18
meta : { } ,
19
19
errorMessage : null ,
20
20
displayMetadata : true ,
21
- initialValue : { } ,
22
21
messages : {
23
22
UNKOWN_ERROR : $t ( 'Sorry, there was an error getting requested content. ' +
24
23
'Please contact the store owner.' ) ,
@@ -44,61 +43,16 @@ define([
44
43
}
45
44
} ,
46
45
listens : {
47
- id : 'updateFromServer' ,
48
- '${ $.provider }:data.reset' : 'reset'
46
+ id : 'updateFromServer'
49
47
}
50
48
} ,
51
49
52
- /**
53
- * Invokes initialize method of parent class,
54
- * contains initialization logic
55
- */
56
- initialize : function ( ) {
57
- _ . bindAll ( this , 'reset' ) ;
58
-
59
- this . _super ( )
60
- . setInitialValue ( ) ;
61
-
62
- return this ;
63
- } ,
64
-
65
- /**
66
- * Sets initial value of the element and subscribes to it's changes.
67
- *
68
- * @returns {Abstract } Chainable.
69
- */
70
- setInitialValue : function ( ) {
71
- if ( this . id ( ) ) {
72
- this . initialValue ( false ) ;
73
- }
74
- return this ;
75
- } ,
76
-
77
50
/**
78
51
* @inheritdoc
79
52
*/
80
53
initObservable : function ( ) {
81
54
return this . _super ( )
82
- . observe ( 'id meta errorMessage displayMetadata initialValue' ) ;
83
- } ,
84
-
85
- /**
86
- * Resets metadata
87
- *
88
- * @returns void
89
- */
90
- reset : function ( ) {
91
- this . meta ( this . initialValue ( ) ) ;
92
- this . errorMessage ( null ) ;
93
- } ,
94
-
95
- /**
96
- * Resets metadata
97
- *
98
- * @returns void
99
- */
100
- reset : function ( ) {
101
- this . meta ( { } ) ;
55
+ . observe ( 'id meta errorMessage displayMetadata' ) ;
102
56
} ,
103
57
104
58
/**
@@ -111,6 +65,7 @@ define([
111
65
112
66
// The component hasn't be configured yet. Nothing to do.
113
67
if ( ! this . id ( ) || ! this . requestParameter || ! this . dataUrlConfigPath ) {
68
+ this . meta ( { } ) ;
114
69
return ;
115
70
}
116
71
@@ -136,9 +91,6 @@ define([
136
91
}
137
92
138
93
this . meta ( response ) ;
139
- if ( this . initialValue ( ) === false ) {
140
- this . initialValue ( response )
141
- }
142
94
} . bind ( this ) )
143
95
. fail ( function ( ) {
144
96
this . meta ( { } ) ;
0 commit comments